diff --git a/src/main/java/shape/tp5/Rectangle.java b/src/main/java/shape/tp5/Rectangle.java index a86216966de1cfea5c6426939e787ea28eb468e3..0f2ebd406ea51cc80881c304b7f34c161a629ece 100644 --- a/src/main/java/shape/tp5/Rectangle.java +++ b/src/main/java/shape/tp5/Rectangle.java @@ -13,12 +13,12 @@ public class Rectangle implements Shape { @Override public void paint(GraphicsContext graphicsContext) { - graphicsContext.strokeRect(x, y, width, height); + graphicsContext.fillRect(x, y, width, height); } @Override - public boolean contains(double px, double py) { - return px >= x && px <= x + width && py >= y && py <= y + height; + public boolean contains(double x, double y) { + return x >= this.x && x <= this.x + width && y >= this.y && y <= this.y + height; } @Override