summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-05 04:40:05 -0600
committerJeff Carr <[email protected]>2024-02-05 04:40:05 -0600
commit825be13ee98bff8a981a905afa3a4f6402cf10ca (patch)
tree9a275527e914c59a2b9db0b47d3df4a31057c8e4
parent56cebf6db647436734950f157ab286d69bc32486 (diff)
found box direction error
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--place.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/place.go b/place.go
index 4f24c48..03fa579 100644
--- a/place.go
+++ b/place.go
@@ -8,8 +8,8 @@ import (
"go.wit.com/widget"
)
-func (tk *guiWidget) placeBox(startW int, startH int) {
- if tk.WidgetType != widget.Box {
+func (w *guiWidget) placeBox(startW int, startH int) {
+ if w.WidgetType != widget.Box {
return
}
// tk.dumpTree("beforebox")
@@ -17,21 +17,21 @@ func (tk *guiWidget) placeBox(startW int, startH int) {
newW := startW
newH := startH
- for _, child := range tk.children {
+ for _, child := range w.children {
sizeW, sizeH := child.Size()
log.Log(INFO, "BOX START size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH)
child.placeWidgets(newW, newH)
+ // re-get the Size (they should not have changed, but maybe they can?)
+ // TODO: figure this out or report that they did
sizeW, sizeH = child.Size()
- if child.node.State.Direction == widget.Vertical {
- log.Log(INFO, "BOX IS VERTICAL ", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String())
+ if w.node.State.Direction == widget.Vertical {
+ log.Log(INFO, "BOX IS VERTICAL ", w.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String())
// expand based on the child height
- // something is wrong here
- newW += sizeW
+ newH += sizeH
} else {
- log.Log(INFO, "BOX IS HORIZONTAL", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String())
+ log.Log(INFO, "BOX IS HORIZONTAL", w.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String())
// expand based on the child width
- // something is wrong here
- newH += sizeH
+ newW += sizeW
}
log.Log(INFO, "BOX END size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH)
}