Improved shoes-iness; no longer need to pass clear blocks an element to parent to, todo: replace global var with something else.

This commit is contained in:
2020-01-13 20:13:03 -06:00
parent a267695b1c
commit 4b25d724b5
3 changed files with 12 additions and 5 deletions

View File

@@ -2,7 +2,6 @@ module CyberarmEngine
class Element
class Container < Element
include Common
include CyberarmEngine::DSL
attr_accessor :stroke_color, :fill_color
attr_reader :children, :gui_state
@@ -35,8 +34,13 @@ module CyberarmEngine
def clear(&block)
@children.clear
old_container = $__current_container__
$__current_container__ = self
block.call(self) if block
$__current_container__ = old_container
recalculate
root.gui_state.request_recalculate
end