Ejemplo n.º 1
0
        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)));
        }