mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-15 20:52:35 +00:00
Fixed Container not considering padding when clipping render area
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user