public static Size2 GetSizeWithMargins(GuiControl control, IGuiContext context, Size2 availableSize) { return(control.GetDesiredSize(context, availableSize) + control.Margin.Size); }