Apply padding correctly when painting Container's children

This commit is contained in:
Antonio Scandurra 2021-03-23 10:59:35 +01:00
parent bac543657c
commit 43abd96769

View file

@ -169,7 +169,9 @@ impl Element for Container {
border: self.border,
corner_radius: self.corner_radius,
});
self.child.paint(bounds.origin(), ctx);
let child_origin = quad_bounds.origin() + vec2f(self.padding.left, self.padding.top);
self.child.paint(child_origin, ctx);
}
fn dispatch_event(