summaryrefslogtreecommitdiff
path: root/engine/UI/GridColumn.go
diff options
context:
space:
mode:
authorPhyscik <mynameisgennadiy@vk.com>2026-02-06 01:55:27 +0500
committerPhyscik <mynameisgennadiy@vk.com>2026-02-06 01:55:27 +0500
commit85666467056ccae2011128e0d38ea2dbd1efee8a (patch)
treefa91af8a8e9be05e6ef87a4ecddc6b3f0303dea4 /engine/UI/GridColumn.go
parente071f6670cf2d379237bf9cc66bd99696e48df8d (diff)
Menu description pt. 1
Diffstat (limited to 'engine/UI/GridColumn.go')
-rw-r--r--engine/UI/GridColumn.go13
1 files changed, 7 insertions, 6 deletions
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,