grid size works

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-28 21:22:34 -06:00
parent 4fa1dd75b0
commit 9aa1dd1a37
1 changed files with 8 additions and 23 deletions

27
size.go
View File

@ -66,31 +66,16 @@ func (w *guiWidget) sizeGrid() (int, int) {
} }
} }
var maxW int = 0
var maxH int = 0
// find the width and height offset of the grid for AtW,AtH // find the width and height offset of the grid for AtW,AtH
for _, child := range w.children { var totalW int = 0
var totalW, totalH int var totalH int = 0
for i, w := range w.widths { for _, width := range w.widths {
if i < child.node.State.AtW { totalW += width
totalW += w
} }
} for _, h := range w.heights {
for i, h := range w.heights {
if i < child.node.State.AtH {
totalH += h totalH += h
} }
} return totalW, totalH
if totalW > maxW {
maxW = totalW
}
if totalH > maxH {
maxH = totalH
}
}
return maxW, maxH
} }
func (tk *guiWidget) sizeBox() (int, int) { func (tk *guiWidget) sizeBox() (int, int) {