mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-18 22:02:34 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user