Overlays must be handled & rendered in their order.
This commit is contained in:
parent
cdc999ad42
commit
352984d6d9
@ -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 {
|
||||
var handled bool
|
||||
for overlay, visible := range o.visible {
|
||||
if visible {
|
||||
for _, overlay := range o.order {
|
||||
if o.visible[overlay] {
|
||||
if o.overlays[overlay].Handle(ctx, e) { // handle all overlays regardless of return value
|
||||
handled = true
|
||||
}
|
||||
@ -92,8 +92,8 @@ func (o *Overlays) Hide(name string) { o.SetVisibility(name, false) }
|
||||
|
||||
func (o *Overlays) Render(ctx Context) {
|
||||
o.Proxy.Render(ctx)
|
||||
for overlay, visible := range o.visible {
|
||||
if visible {
|
||||
for _, overlay := range o.order {
|
||||
if o.visible[overlay] {
|
||||
o.overlays[overlay].Render(ctx)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user