lib/rabbit/element/container-element.rb in rabbit-2.1.2 vs lib/rabbit/element/container-element.rb in rabbit-2.1.3

- old
+ new

@@ -75,21 +75,23 @@ def draw_element(canvas, x, y, w, h, simulation) draw_elements(canvas, x, y, w, h, simulation) end def draw_elements(canvas, x, y, w, h, simulation) + @centering_adjusted_height = 0 + args = [x, y, w, h] - adjust_height = 0 if do_vertical_centering? adjust_height = ((h - height - @padding_bottom) / 2.0).ceil if y + adjust_height > 0 args = [x, y + adjust_height, w, h - adjust_height] else adjust_height = 0 end + @centering_adjusted_height = adjust_height + compile_elements(canvas, *args) end - @centering_adjusted_height = adjust_height - compile_elements(canvas, *args) + base_x, base_w = x, w @elements.each do |element| x, y, w, h = element.draw(simulation) end last_element = @elements.last