Fixed Container not considering padding when clipping render area

This commit is contained in:
2022-01-29 10:08:33 -06:00
parent c8734ae98b
commit 2be5733bc1

View File

@@ -57,7 +57,12 @@ module CyberarmEngine
end end
def render def render
Gosu.clip_to(@x, @y, width, height) do Gosu.clip_to(
@x + @style.border_thickness_left + @style.padding_left,
@y + @style.border_thickness_top + @style.padding_top,
content_width + 1,
content_height + 1
) do
@children.each(&:draw) @children.each(&:draw)
end end
end end
@@ -103,6 +108,8 @@ module CyberarmEngine
stylize stylize
# s = Gosu.milliseconds
layout layout
if is_root? if is_root?
@@ -134,6 +141,8 @@ module CyberarmEngine
child.y >= @y - child.height && child.y <= @y + height child.y >= @y - child.height && child.y <= @y + height
end end
# puts "TOOK: #{Gosu.milliseconds - s}ms to recalculate #{self.class}:0x#{self.object_id.to_s(16)}"
update_background update_background
end end