(From aduros) AbstractRectangle.contains should contain bounds.
Points on the top and left edges are considered contained, so should points on right and bottom. This also makes contains() consistent with outcode().
This commit is contained in:
@@ -108,7 +108,7 @@ public abstract class AbstractRectangle extends RectangularShape implements IRec
|
|||||||
|
|
||||||
px -= x;
|
px -= x;
|
||||||
py -= y;
|
py -= y;
|
||||||
return px < width() && py < height();
|
return px <= width() && py <= height();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from interface IShape
|
@Override // from interface IShape
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public abstract class AbstractRectangle extends RectangularShape implements IRec
|
|||||||
|
|
||||||
px -= x;
|
px -= x;
|
||||||
py -= y;
|
py -= y;
|
||||||
return px < width() && py < height();
|
return px <= width() && py <= height();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from interface IShape
|
@Override // from interface IShape
|
||||||
|
|||||||
Reference in New Issue
Block a user