Draw only visible windows

This commit is contained in:
Bo Maryniuk 2020-10-19 18:34:12 +02:00
parent bbe99c97ca
commit 8f11148f11
1 changed files with 6 additions and 4 deletions

View File

@ -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)
}
}
}