Make all those take "width" and "height".
Before, it was a mix of that and "w" and "h", which lends itself to problems such as the bug that gets fixed here where Ellipse.setFrame() was broken because "this.width = width" was a no-op given the method's argument was "w"
This commit is contained in:
@@ -57,7 +57,7 @@ public class Ellipse extends AbstractEllipse implements Serializable
|
||||
}
|
||||
|
||||
@Override // from RectangularShape
|
||||
public void setFrame (float x, float y, float w, float h) {
|
||||
public void setFrame (float x, float y, float width, float height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
|
||||
@@ -19,13 +19,13 @@ public interface IShape
|
||||
boolean contains (IPoint point);
|
||||
|
||||
/** Returns true if this shape completely contains the specified rectangle. */
|
||||
boolean contains (float x, float y, float w, float h);
|
||||
boolean contains (float x, float y, float width, float height);
|
||||
|
||||
/** Returns true if this shape completely contains the supplied rectangle. */
|
||||
boolean contains (IRectangle r);
|
||||
|
||||
/** Returns true if this shape intersects the specified rectangle. */
|
||||
boolean intersects (float x, float y, float w, float h);
|
||||
boolean intersects (float x, float y, float width, float height);
|
||||
|
||||
/** Returns true if this shape intersects the supplied rectangle. */
|
||||
boolean intersects (IRectangle r);
|
||||
|
||||
@@ -27,9 +27,7 @@ public class Rectangle extends AbstractRectangle implements Serializable
|
||||
* Constructs a rectangle at (0,0) and with dimensions (0,0).
|
||||
*/
|
||||
public Rectangle () {
|
||||
}
|
||||
|
||||
/**
|
||||
} /**
|
||||
* Constructs a rectangle with the supplied upper-left corner and dimensions (0,0).
|
||||
*/
|
||||
public Rectangle (IPoint p) {
|
||||
@@ -182,7 +180,7 @@ public class Rectangle extends AbstractRectangle implements Serializable
|
||||
}
|
||||
|
||||
@Override // from RectangularShape
|
||||
public void setFrame (float x, float y, float w, float h) {
|
||||
setBounds(x, y, w, h);
|
||||
public void setFrame (float x, float y, float width, float height) {
|
||||
setBounds(x, y, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public abstract class RectangularShape implements IRectangularShape
|
||||
/**
|
||||
* Sets the location and size of the framing rectangle of this shape to the specified values.
|
||||
*/
|
||||
public abstract void setFrame (float x, float y, float w, float h);
|
||||
public abstract void setFrame (float x, float y, float width, float height);
|
||||
|
||||
/**
|
||||
* Sets the location and size of the framing rectangle of this shape to the supplied values.
|
||||
|
||||
Reference in New Issue
Block a user