Revision: 792 Author: allain.lalonde Date: Wed Oct 21 14:03:04 2009 Log: Fixed bug found in r88. Translation was being computed incorrectly for Aspect Cover. It now lines up the center of the PNode and the center of the image. http://code.google.com/p/piccolo2d/source/detail?r=792
Modified: /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java ======================================= --- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java Mon Oct 19 10:43:18 2009 +++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java Wed Oct 21 14:03:04 2009 @@ -459,7 +459,7 @@ public void setRelativeTargetValue(final float zeroToOne) { PNode.this.setBounds(src.x + zeroToOne * (dst.x - src.x), src.y + zeroToOne * (dst.y - src.y), src.width + zeroToOne * (dst.width - src.width), src.height + zeroToOne - * (dst.height - src.height)); + * (dst.height - src.height)); } protected void activityFinished() { @@ -1454,8 +1454,8 @@ } /** - * Set the bounds of this node to the given position and size. These bounds are stored - * in the local coordinate system of this node. + * Set the bounds of this node to the given position and size. These bounds + * are stored in the local coordinate system of this node. * * If the width or height is less then or equal to zero then the bound's * empty bit will be set to true. @@ -2942,7 +2942,7 @@ scale = image.getHeight() / nodeHeight; } g2.scale(scale, scale); - g2.translate(-nodeWidth * scale, -nodeHeight * scale); + g2.translate(-nodeWidth / scale, -nodeHeight / scale); break; case FILL_STRATEGY_EXACT_FIT: // scale the node so that it covers then entire image, --~--~---------~--~----~------------~-------~--~----~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~----------~----~----~----~------~----~------~--~---