summaryrefslogtreecommitdiffstats
path: root/wgpu/src/widget/canvas/path/builder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/widget/canvas/path/builder.rs')
-rw-r--r--wgpu/src/widget/canvas/path/builder.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/wgpu/src/widget/canvas/path/builder.rs b/wgpu/src/widget/canvas/path/builder.rs
index a013149e..6511fa52 100644
--- a/wgpu/src/widget/canvas/path/builder.rs
+++ b/wgpu/src/widget/canvas/path/builder.rs
@@ -133,11 +133,14 @@ impl Builder {
///
/// [`Path`]: struct.Path.html
#[inline]
- pub fn rectangle(&mut self, p: Point, size: Size) {
- self.move_to(p);
- self.line_to(Point::new(p.x + size.width, p.y));
- self.line_to(Point::new(p.x + size.width, p.y + size.height));
- self.line_to(Point::new(p.x, p.y + size.height));
+ pub fn rectangle(&mut self, top_left: Point, size: Size) {
+ self.move_to(top_left);
+ self.line_to(Point::new(top_left.x + size.width, top_left.y));
+ self.line_to(Point::new(
+ top_left.x + size.width,
+ top_left.y + size.height,
+ ));
+ self.line_to(Point::new(top_left.x, top_left.y + size.height));
self.close();
}