1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| package top.lhxone.myRect;
public class PlainRect extends Rect { double startX, startY;
PlainRect() { this.startX = 1.0; this.startY = 1.0; super.height = 1.0; super.width = 1.0; }
public PlainRect(double X, double Y, double width, double height) { this.startX = X; this.startY = Y; super.width = width; super.height = height; }
public boolean isInside(double x, double y) { if (x < startX + width && x > startX && y < startY && y > startY - height) { return true; } else { return false; } } }
|