Inset container contents to account for container border

This commit is contained in:
Nathan Sobo
2021-04-01 10:31:00 -06:00
parent e487aa5cbd
commit 995acefce5
2 changed files with 19 additions and 1 deletions
+3 -1
View File
@@ -168,7 +168,9 @@ impl Element for Container {
corner_radius: self.corner_radius,
});
let child_origin = quad_bounds.origin() + vec2f(self.padding.left, self.padding.top);
let child_origin = quad_bounds.origin()
+ vec2f(self.padding.left, self.padding.top)
+ vec2f(self.border.left_width(), self.border.top_width());
self.child.paint(child_origin, ctx);
}