changeset 7719:83f2a3753ad6

RT-38130 A node remains invisible if clip has been set while it was not visible
author Martin Sladecek <martin.sladecek@oracle.com>
date Tue, 19 Aug 2014 14:40:16 +0200
parents e74cd136a22d
children 0c8c5cd4ad4e
files modules/graphics/src/main/java/javafx/scene/Node.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/scene/Node.java	Tue Aug 19 10:15:23 2014 +0100
+++ b/modules/graphics/src/main/java/javafx/scene/Node.java	Tue Aug 19 14:40:16 2014 +0200
@@ -518,6 +518,13 @@
 
     // Happens before we hold the sync lock
     void updateBounds() {
+        // Note: the clip must be handled before the visibility is checked. This is because the visiblity might be
+        // changing in the clip and it is going to be synchronized, so it needs to recompute the bounds.
+        Node n = getClip();
+        if (n != null) {
+            n.updateBounds();
+        }
+
         // See impl_syncPeer()
         if (!treeVisible && !impl_isDirty(DirtyBits.NODE_VISIBLE)) {
             return;
@@ -535,10 +542,6 @@
                     BaseTransform.IDENTITY_TRANSFORM);
         }
 
-        Node n = getClip();
-        if (n != null) {
-            n.updateBounds();
-        }
     }
 
     /**