summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Gui/Controls/Canvas.cs
blob: d667a73cdfd6bf4d4ecc7b3ed4f1f172ef4b95e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using Microsoft.Xna.Framework;

namespace MonoGame.Extended.Gui.Controls
{
    public class Canvas : LayoutControl
    {
        public Canvas()
        {
        }
        
        protected override void Layout(IGuiContext context, Rectangle rectangle)
        {
            foreach (var control in Items)
            {
                var actualSize = control.CalculateActualSize(context);
                PlaceControl(context, control, control.Position.X, control.Position.Y, actualSize.Width, actualSize.Height);
            }
        }

        public override Size GetContentSize(IGuiContext context)
        {
            return new Size();
        }
    }
}