示例#1
0
文件: CloudBuilder.cs 项目: qoter/di
        private IEnumerable <Tag> CreateTags(Size cloudSize)
        {
            var currentSize        = layouter.CalculateSize();
            var widthResizeFactor  = (double)cloudSize.Width / currentSize.Width;
            var heightResizeFactor = (double)cloudSize.Height / currentSize.Height;

            var places = layouter.PlacedRectangles
                         .Select(rect => rect.Resize(widthResizeFactor, heightResizeFactor))
                         .ShiftToFirstQuadrant();

            return(placedWords.Zip(places, (word, place) => new Tag(word, place)));
        }