Revision: 970
Author: allain.lalonde
Date: Tue Feb 9 07:58:01 2010
Log: Reverting r923 since it was a breaking change. It will need to be
redone in 2.0. Seems that some apps were making use of this behaviour.
http://code.google.com/p/piccolo2d/source/detail?r=970
Modified:
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PBounds.java
/piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/util/PBoundsTest.java
=======================================
---
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PBounds.java
Mon Jan 18 16:07:38 2010
+++
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PBounds.java
Tue Feb 9 07:58:01 2010
@@ -233,7 +233,10 @@
* @param bounds bounds being added
*/
public void add(final PBounds bounds) {
- if (isEmpty) {
+ if (bounds.isEmpty) {
+ return;
+ }
+ else if (isEmpty) {
x = bounds.x;
y = bounds.y;
width = bounds.width;
=======================================
---
/piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/util/PBoundsTest.java
Mon Jan 18 16:07:38 2010
+++
/piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/util/PBoundsTest.java
Tue Feb 9 07:58:01 2010
@@ -31,7 +31,6 @@
import java.awt.geom.Rectangle2D;
import junit.framework.TestCase;
-import edu.umd.cs.piccolo.PNode;
import edu.umd.cs.piccolo.PiccoloAsserts;
/**
@@ -82,10 +81,11 @@
PiccoloAsserts.assertEquals(new PDimension(10, 10), b.getSize(),
0.00001);
}
- public void testWhenBoundsHas0HeightFullBoundsIsCorrectlyReturned() {
- final PNode node = new PNode();
- final PBounds testBounds = new PBounds(10, 10, 10, 0);
- node.setBounds(testBounds);
- assertEquals(testBounds, node.getFullBounds());
- }
-}
+ // TODO: This test should pass, but making it do so would break binary
compatability
+ /*
+ * public void testWhenBoundsHas0HeightFullBoundsIsCorrectlyReturned()
{
+ * final PNode node = new PNode(); final PBounds testBounds = new
+ * PBounds(10, 10, 10, 0); node.setBounds(testBounds);
+ * assertEquals(testBounds, node.getFullBounds()); }
+ */
+}
--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en