Beispiel #1
0
        /// <summary>
        /// 矩形の追加
        /// </summary>
        /// <param name="item">追加する矩形情報</param>
        public void Add(BoxLayoutItem item)
        {
            // 矩形の高さ毎に分類、格納する
            List<BoxLayoutItem> itemBacket;
            if (!itemBackets.TryGetValue(item.Bounds.Height, out itemBacket))
            {
                itemBacket = new List<BoxLayoutItem>();
                itemBackets.Add(item.Bounds.Height, itemBacket);
            }

            itemBacket.Add(item);

            // 必要な矩形面積を追加
            int w = item.Bounds.Width + PadSize;
            int h = item.Bounds.Height + PadSize;
            totalAreaSize += (w * h);

            Items.Add(item);
        }
Beispiel #2
0
        /// <summary>
        /// 矩形の追加
        /// </summary>
        /// <param name="item">追加する矩形情報</param>
        public void Add(BoxLayoutItem item)
        {
            // 矩形の高さ毎に分類、格納する
            List <BoxLayoutItem> itemBacket;

            if (!itemBackets.TryGetValue(item.Bounds.Height, out itemBacket))
            {
                itemBacket = new List <BoxLayoutItem>();
                itemBackets.Add(item.Bounds.Height, itemBacket);
            }

            itemBacket.Add(item);

            // 必要な矩形面積を追加
            int w = item.Bounds.Width + PadSize;
            int h = item.Bounds.Height + PadSize;

            totalAreaSize += (w * h);

            Items.Add(item);
        }