Don't trigger a recalc when hiding/showing elements if they're already in that state

This commit is contained in:
2020-12-09 19:11:28 -06:00
parent fb36436d79
commit 2d57d62bc2

View File

@@ -135,17 +135,19 @@ module CyberarmEngine
end end
def show def show
bool = visible?
@visible = true @visible = true
root.gui_state.request_recalculate root.gui_state.request_recalculate unless bool
end end
def hide def hide
bool = visible?
@visible = false @visible = false
root.gui_state.request_recalculate root.gui_state.request_recalculate if bool
end end
def draw def draw
return unless @visible return unless visible?
@style.background_canvas.draw @style.background_canvas.draw
@style.border_canvas.draw @style.border_canvas.draw