mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 13:12:34 +00:00
Root Container width/height now always match window
This commit is contained in:
@@ -60,8 +60,13 @@ module CyberarmEngine
|
|||||||
|
|
||||||
layout
|
layout
|
||||||
|
|
||||||
@style.width = @max_width ? @max_width : (@children.map {|c| c.x + c.outer_width }.max || 0).round
|
if is_root?
|
||||||
@style.height = @max_height ? @max_height : (@children.map {|c| c.y + c.outer_height}.max || 0).round
|
@style.width = window.width
|
||||||
|
@style.height = window.height
|
||||||
|
else
|
||||||
|
@style.width = @max_width ? @max_width : (@children.map {|c| c.x + c.outer_width }.max || 0).round
|
||||||
|
@style.height = @max_height ? @max_height : (@children.map {|c| c.y + c.outer_height}.max || 0).round
|
||||||
|
end
|
||||||
|
|
||||||
# Move child to parent after positioning
|
# Move child to parent after positioning
|
||||||
@children.each do |child|
|
@children.each do |child|
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ module CyberarmEngine
|
|||||||
@root
|
@root
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_root?
|
||||||
|
@gui_state != nil
|
||||||
|
end
|
||||||
|
|
||||||
def recalculate
|
def recalculate
|
||||||
raise "#{self.class}#recalculate was not overridden!"
|
raise "#{self.class}#recalculate was not overridden!"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user