mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 21:22:33 +00:00
Don't trigger a recalc when hiding/showing elements if they're already in that state
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user