From 85666467056ccae2011128e0d38ea2dbd1efee8a Mon Sep 17 00:00:00 2001 From: Physcik Date: Fri, 6 Feb 2026 01:55:27 +0500 Subject: Menu description pt. 1 --- engine/UI/GridColumn.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'engine/UI/GridColumn.go') diff --git a/engine/UI/GridColumn.go b/engine/UI/GridColumn.go index 359d0d4..b933cf4 100644 --- a/engine/UI/GridColumn.go +++ b/engine/UI/GridColumn.go @@ -4,20 +4,20 @@ import rl "github.com/gen2brain/raylib-go/raylib" type GridColumn struct { // A portion of the screen the row will occupy. Works similar to CSS's 'flex-grow' - WidthWeight float32 - // The objects that lay in this row - Spacing float32 + Weight float32 // Spaces between the columns Objects []UIElement + // The objects that lay in this row + Spacing float32 // Styling preferences - Style *Style + Style Style `json:"-"` location rl.Rectangle cache layoutCache } func (base *GridColumn) Init(parent *Menu) { - base.Style = InitStyle(base.Style, defaultGridStyle) + base.Style.FillMissing(defaultGridStyle) for _, v := range base.Objects { v.Init(parent) } @@ -31,7 +31,7 @@ func (base *GridColumn) Destroy() { // Gets the scale width of the element. Works similar to CSS's 'flex-grow' func (base *GridColumn) GetOccupationWeight() float32 { - return base.WidthWeight + return base.Weight } // Draw the element with the given size @@ -41,6 +41,7 @@ func (base *GridColumn) Draw(span *rl.Rectangle) { } for i, v := range base.Objects { var offset = base.cache.RowLocations[i] + rl.TraceLog(rl.LogInfo, "Cache: %v", base.cache) var elemSpan = rl.Rectangle { X: span.X + *base.Style.Padding, Y: offset.X, -- cgit v1.3