Browse Source

Draw only visible windows

tablepad
Bo Maryniuk 2 years ago
parent
commit
8f11148f11
  1. 10
      windowmanager.go

10
windowmanager.go

@ -73,7 +73,7 @@ func (wm *WindowManager) Draw(screen tcell.Screen) {
var hasFullScreen bool
for _, w := range wm.windows {
if !w.fullscreen {
if !w.fullscreen || !w.IsVisible() {
continue
}
@ -88,9 +88,11 @@ func (wm *WindowManager) Draw(screen tcell.Screen) {
}
for _, w := range wm.windows {
w.SetBorder(true)
w.SetRect(x+w.x, x+w.y, w.width, w.height)
w.Draw(screen)
if w.IsVisible() {
w.SetBorder(true)
w.SetRect(x+w.x, x+w.y, w.width, w.height)
w.Draw(screen)
}
}
}

Loading…
Cancel
Save