Skip to content

Commit

Permalink
keep tree Alloc size updated to Actual -- important now that Alloc is…
Browse files Browse the repository at this point in the history
… used for bbox.
  • Loading branch information
rcoreilly committed Dec 23, 2024
1 parent a6e8b78 commit 0ab7005
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ func (tr *Tree) Position() {
sz := &tr.Geom.Size
sz.Actual.Total.X = rn.Geom.Size.Actual.Total.X - (tr.Geom.Pos.Total.X - rn.Geom.Pos.Total.X)
sz.Actual.Content.X = sz.Actual.Total.X - sz.Space.X
sz.Alloc = sz.Actual
tr.widgetSize.X = sz.Actual.Total.X
tr.WidgetBase.Position() // just does our parts

Expand All @@ -611,10 +612,12 @@ func (tr *Tree) ApplyScenePos() {
sz := &tr.Geom.Size
if sz.Actual.Total == tr.widgetSize {
sz.setTotalFromContent(&sz.Actual) // restore after scrolling
sz.Alloc = sz.Actual
}
tr.WidgetBase.ApplyScenePos()
tr.applyScenePosChildren()
tr.Geom.Size.Actual.Total = tr.widgetSize // key: we revert to just ourselves
sz.Actual.Total = tr.widgetSize // key: we revert to just ourselves
sz.Alloc = sz.Actual
}

func (tr *Tree) Render() {
Expand Down

0 comments on commit 0ab7005

Please sign in to comment.