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
|
@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.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.width = width;
|
this.width = width;
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ public interface IShape
|
|||||||
boolean contains (IPoint point);
|
boolean contains (IPoint point);
|
||||||
|
|
||||||
/** Returns true if this shape completely contains the specified rectangle. */
|
/** 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. */
|
/** Returns true if this shape completely contains the supplied rectangle. */
|
||||||
boolean contains (IRectangle r);
|
boolean contains (IRectangle r);
|
||||||
|
|
||||||
/** Returns true if this shape intersects the specified rectangle. */
|
/** 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. */
|
/** Returns true if this shape intersects the supplied rectangle. */
|
||||||
boolean intersects (IRectangle r);
|
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).
|
* Constructs a rectangle at (0,0) and with dimensions (0,0).
|
||||||
*/
|
*/
|
||||||
public Rectangle () {
|
public Rectangle () {
|
||||||
}
|
} /**
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a rectangle with the supplied upper-left corner and dimensions (0,0).
|
* Constructs a rectangle with the supplied upper-left corner and dimensions (0,0).
|
||||||
*/
|
*/
|
||||||
public Rectangle (IPoint p) {
|
public Rectangle (IPoint p) {
|
||||||
@@ -182,7 +180,7 @@ public class Rectangle extends AbstractRectangle implements Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override // from RectangularShape
|
@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) {
|
||||||
setBounds(x, y, w, h);
|
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.
|
* 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.
|
* Sets the location and size of the framing rectangle of this shape to the supplied values.
|
||||||
|
|||||||
Reference in New Issue
Block a user