Hey guys,
The getCenterOfRotationX() and getCenterOfRotationY() in the image class might return an incorrect value of 0 even when it is otherwise.
This is the current code:
Code:
/**
* Get the x component of the center of rotation of this image
*
* @return The x component of the center of rotation
*/
public float getCenterOfRotationX() {
return centerX;
}
/**
* Get the y component of the center of rotation of this image
*
* @return The y component of the center of rotation
*/
public float getCenterOfRotationY() {
return centerY;
}
I believe it would be fine if you just added a call to the init() method, just like you do in getWidth and getHeight, like so:
Code:
/**
* Get the x component of the center of rotation of this image
*
* @return The x component of the center of rotation
*/
public float getCenterOfRotationX() {
init();
return centerX;
}
/**
* Get the y component of the center of rotation of this image
*
* @return The y component of the center of rotation
*/
public float getCenterOfRotationY() {
init();
return centerY;
}
If you do not want the performance hit due to the method call, I guess the next best solution would just be to place the call to init() in the constructors.
Thanks.