FLEX_34219 ToolTipManager bug.  Accept patch from Constantin A (with some minor 
modifications)


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/0c91593a
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/0c91593a
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/0c91593a

Branch: refs/heads/master
Commit: 0c91593a8d18f6348ad8434bf48acda148719bc0
Parents: fae2059
Author: Alex Harui <[email protected]>
Authored: Sun Jun 22 07:26:51 2014 -0700
Committer: Alex Harui <[email protected]>
Committed: Sun Jun 22 07:26:51 2014 -0700

----------------------------------------------------------------------
 .../src/mx/managers/ToolTipManagerImpl.as       | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0c91593a/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as 
b/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as
index 2d20b86..f8f5412 100644
--- a/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as
+++ b/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as
@@ -711,11 +711,43 @@ public class ToolTipManagerImpl extends EventDispatcher
                if (target is IFlexDisplayObject && 
!IFlexDisplayObject(target).visible)
                        return false;
                
+        if (!isVisibleParentsIncluded(target))
+            return false;
+        
        return target.hitTestPoint(target.stage.mouseX,
                                                           target.stage.mouseY, 
true);
     }
     
     /**
+     * @private
+     * <p>Determines if the UIComponent and the parents in the hierarchy
+     * are visible, if yes return true, otherwise returns false.</p>
+     *
+     * @param target DisplayObject
+     * @return Boolean true is all parents are visible, false if one of them 
is invisible
+     */
+    private function isVisibleParentsIncluded(target:DisplayObject):Boolean 
+    {
+        if (target == null) return false;
+        return isTopLevelApplication(target) ? target.visible :
+                    target.visible && isVisibleParentsIncluded(target.parent);
+    }
+    
+    /**
+     * @private
+     *
+     * <p>Determines if the target is topLevelApplication and
+     * returns true if yes, otherwise false
+     *
+     * @param target UIComponent
+     * @return Boolean true is is topLevelApplication, otherwise false
+     */
+    private function isTopLevelApplication(target:DisplayObject):Boolean 
+    {
+        return target == FlexGlobals.topLevelApplication;
+    }
+    
+    /**
      *  @private
      *  Shows the tip immediately when the toolTip or errorTip property 
      *  becomes non-null and the mouse is over the target.

Reply via email to