flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX_34219 ToolTipManager bug. Accept patch from Constantin A (with some minor modifications)
Date Sun, 22 Jun 2014 14:28:58 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/develop fae2059b9 -> 8e5460121


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/develop
Commit: 0c91593a8d18f6348ad8434bf48acda148719bc0
Parents: fae2059
Author: Alex Harui <aharui@apache.org>
Authored: Sun Jun 22 07:26:51 2014 -0700
Committer: Alex Harui <aharui@apache.org>
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.


Mime
View raw message