lib/cyberarm_engine/ui/container.rb in cyberarm_engine-0.7.0 vs lib/cyberarm_engine/ui/container.rb in cyberarm_engine-0.7.1
- old
+ new
@@ -62,20 +62,20 @@
self if hit?(x, y)
end
def recalculate
- @current_position = Vector.new(@margin_left, @margin_top)
+ @current_position = Vector.new(@margin_left + @padding_left, @margin_top + @padding_top)
unless @visible
@width = 0
@height= 0
return
end
layout
- @width = @max_width ? @max_width : (@children.map {|c| c.x + c.width + c.margin_right }.max || 0).round
- @height = @max_height ? @max_height : (@children.map {|c| c.y + c.height + c.margin_bottom}.max || 0).round
+ @width = @max_width ? @max_width : (@children.map {|c| c.x + c.outer_width }.max || 0).round
+ @height = @max_height ? @max_height : (@children.map {|c| c.y + c.outer_height}.max || 0).round
# Move child to parent after positioning
@children.each do |child|
child.x += @x
child.y += @y
\ No newline at end of file