Revision: 1040
Author: heuermh
Date: Fri Aug  6 09:02:58 2010
Log: Issue 180 ; rolling back r1008 to r1006
http://code.google.com/p/piccolo2d/source/detail?r=1040

Modified:
 /piccolo2d.java/trunk/core/src/main/java/org/piccolo2d/PNode.java

=======================================
--- /piccolo2d.java/trunk/core/src/main/java/org/piccolo2d/PNode.java Mon May 10 19:42:46 2010 +++ /piccolo2d.java/trunk/core/src/main/java/org/piccolo2d/PNode.java Fri Aug 6 09:02:58 2010
@@ -1877,6 +1877,7 @@
             if (boundsVolatile && !boundsChanged) {
                 signalBoundsChanged();
             }
+

             // 3. If the bounds of on of my decendents are invalidate then
             // validate the bounds of all of my children.
@@ -1903,15 +1904,22 @@
// bounds cache here after our own bounds and the children's bounds
             // have been computed above.
             if (fullBoundsInvalid) {
+                final double oldX = fullBoundsCache.x;
+                final double oldY = fullBoundsCache.y;
+                final double oldWidth = fullBoundsCache.width;
+                final double oldHeight = fullBoundsCache.height;
+                final boolean oldEmpty = fullBoundsCache.isEmpty();
+
                 // 6. This will call getFullBoundsReference on all of the
                 // children. So if the above
                 // layoutChildren method changed the bounds of any of the
                 // children they will be
                 // validated again here.
-                PBounds oldFullBoundsCache = fullBoundsCache;
                 fullBoundsCache = computeFullBounds(fullBoundsCache);

- final boolean fullBoundsChanged = !oldFullBoundsCache.equals(fullBoundsCache); + final boolean fullBoundsChanged = fullBoundsCache.x != oldX || fullBoundsCache.y != oldY + || fullBoundsCache.width != oldWidth || fullBoundsCache.height != oldHeight
+                    || fullBoundsCache.isEmpty() != oldEmpty;

// 7. If the new full bounds cache differs from the previous
                 // cache then
@@ -1922,16 +1930,14 @@
                     if (parent != null) {
                         parent.invalidateFullBounds();
                     }
-
firePropertyChange(PROPERTY_CODE_FULL_BOUNDS, PROPERTY_FULL_BOUNDS, null, fullBoundsCache);

// 8. If our paint was invalid make sure to repaint our old
                     // full bounds. The
// new bounds will be computed later in the validatePaint
                     // pass.
-                    if (paintInvalid && !oldFullBoundsCache.isEmpty()) {
- TEMP_REPAINT_BOUNDS.setRect(oldFullBoundsCache.x, oldFullBoundsCache.getY(), oldFullBoundsCache - .getWidth(), oldFullBoundsCache.getHeight());
+                    if (paintInvalid && !oldEmpty) {
+ TEMP_REPAINT_BOUNDS.setRect(oldX, oldY, oldWidth, oldHeight);
                         repaintFrom(TEMP_REPAINT_BOUNDS, this);
                     }
                 }

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to