Upgraded tomo version

This commit is contained in:
Sasha Koshka 2023-07-06 02:08:10 -04:00
parent 46d7c71f4b
commit ac4e1ddc94
3 changed files with 22 additions and 8 deletions

View File

@ -12,7 +12,7 @@ type containerBox struct {
contentBounds image.Rectangle contentBounds image.Rectangle
scroll image.Point scroll image.Point
gap tomo.Gap gap image.Point
children []anyBox children []anyBox
layout tomo.Layout layout tomo.Layout
@ -55,7 +55,7 @@ func (this *containerBox) OnContentBoundsChange (callback func()) event.Cookie {
return this.on.contentBoundsChange.Connect(callback) return this.on.contentBoundsChange.Connect(callback)
} }
func (this *containerBox) SetGap (gap tomo.Gap) { func (this *containerBox) SetGap (gap image.Point) {
if this.gap == gap { return } if this.gap == gap { return }
this.gap = gap this.gap = gap
this.invalidateLayout() this.invalidateLayout()
@ -143,6 +143,16 @@ func (this *containerBox) canvas () canvas.Canvas {
return this.box.canvas return this.box.canvas
} }
func (this *containerBox) layoutHints () tomo.LayoutHints {
innerBounds := this.InnerBounds().Sub(this.scroll)
return tomo.LayoutHints {
Bounds: innerBounds,
OverflowX: this.hOverflow,
OverflowY: this.vOverflow,
Gap: this.gap,
}
}
func (this *containerBox) doLayout () { func (this *containerBox) doLayout () {
this.box.doLayout() this.box.doLayout()
// TODO: possibly store all children as tomo.Box-es and don't allocate a // TODO: possibly store all children as tomo.Box-es and don't allocate a