mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 05:02:34 +00:00
Fixed hidden elements were interactable, added comments
This commit is contained in:
@@ -18,6 +18,7 @@ module CyberarmEngine
|
||||
|
||||
@label.subscribe(:clicked_left_mouse_button) do |sender, x, y|
|
||||
@toggle_button.clicked_left_mouse_button(sender, x, y)
|
||||
publish(:changed, @toggle_button.value)
|
||||
end
|
||||
|
||||
@label.subscribe(:enter) do |sender|
|
||||
@@ -42,7 +43,8 @@ module CyberarmEngine
|
||||
end
|
||||
|
||||
def value=(bool)
|
||||
@toggle_button.vlaue = bool
|
||||
@toggle_button.value = bool
|
||||
publish(:changed, @toggle_button.value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -57,6 +57,8 @@ module CyberarmEngine
|
||||
|
||||
def hit_element?(x, y)
|
||||
@children.reverse_each do |child|
|
||||
next unless child.visible?
|
||||
|
||||
case child
|
||||
when Container
|
||||
if element = child.hit_element?(x, y)
|
||||
@@ -108,10 +110,12 @@ module CyberarmEngine
|
||||
raise "Not overridden"
|
||||
end
|
||||
|
||||
# TODO: Fix @max_width no longer exists
|
||||
def max_width
|
||||
@max_width ? @max_width : window.width - (@parent ? @parent.style.margin_right + @style.margin_right : @style.margin_right)
|
||||
end
|
||||
|
||||
# TODO: Fix container automatic width (0.0..1.0) not considered
|
||||
def fits_on_line?(element) # Flow
|
||||
@current_position.x + element.outer_width <= max_width &&
|
||||
@current_position.x + element.outer_width <= window.width
|
||||
|
||||
@@ -14,7 +14,7 @@ module CyberarmEngine
|
||||
def clicked_left_mouse_button(sender, x, y)
|
||||
@block.call(self) if @block
|
||||
|
||||
return :handled
|
||||
# return :handled
|
||||
end
|
||||
|
||||
def recalculate
|
||||
|
||||
@@ -57,7 +57,7 @@ module CyberarmEngine
|
||||
@handle.recalculate
|
||||
@handle.update_background
|
||||
|
||||
pp @handle.height
|
||||
# pp @handle.height
|
||||
|
||||
update_background
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user