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
def show
bool = visible?
@visible = true
root.gui_state.request_recalculate
root.gui_state.request_recalculate unless bool
end
def hide
bool = visible?
@visible = false
root.gui_state.request_recalculate
root.gui_state.request_recalculate if bool
end
def draw
return unless @visible
return unless visible?
@style.background_canvas.draw
@style.border_canvas.draw