Compare commits

...

2 Commits

2 changed files with 5 additions and 5 deletions

View File

@ -75,8 +75,8 @@ func (o *Overlays) Arrange(ctx Context, bounds geom.RectangleF32, offset geom.Po
func (o *Overlays) Handle(ctx Context, e Event) bool { func (o *Overlays) Handle(ctx Context, e Event) bool {
var handled bool var handled bool
for overlay, visible := range o.visible { for _, overlay := range o.order {
if visible { if o.visible[overlay] {
if o.overlays[overlay].Handle(ctx, e) { // handle all overlays regardless of return value if o.overlays[overlay].Handle(ctx, e) { // handle all overlays regardless of return value
handled = true handled = true
} }
@ -92,8 +92,8 @@ func (o *Overlays) Hide(name string) { o.SetVisibility(name, false) }
func (o *Overlays) Render(ctx Context) { func (o *Overlays) Render(ctx Context) {
o.Proxy.Render(ctx) o.Proxy.Render(ctx)
for overlay, visible := range o.visible { for _, overlay := range o.order {
if visible { if o.visible[overlay] {
o.overlays[overlay].Render(ctx) o.overlays[overlay].Render(ctx)
} }
} }

View File

@ -81,7 +81,7 @@ func (s *Spacing) Center() {
} }
func (s *Spacing) DesiredSize(ctx Context, size geom.PointF32) geom.PointF32 { func (s *Spacing) DesiredSize(ctx Context, size geom.PointF32) geom.PointF32 {
var content = s.Proxy.DesiredSize(ctx, size) var content = s.Proxy.DesiredSize(ctx, geom.PtF32(s.Width.Zero(size.X), s.Height.Zero(size.Y)))
var w, h = s.Width.Zero(content.X), s.Height.Zero(content.Y) var w, h = s.Width.Zero(content.X), s.Height.Zero(content.Y)
var margin = func(l *Length) float32 { var margin = func(l *Length) float32 {
var v = l.Value() var v = l.Value()