You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by mk...@apache.org on 2013/05/23 02:29:31 UTC

git commit: [flex-sdk] [refs/heads/develop] - FLEX-33189: Allow for better PopUpManager centering of RTL layouts.

Updated Branches:
  refs/heads/develop 5c561804c -> 0e48dac30


FLEX-33189: Allow for better PopUpManager centering of RTL layouts.


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

Branch: refs/heads/develop
Commit: 0e48dac303d93ab406fcc1452d0fcbf1227b60ad
Parents: 5c56180
Author: Mark Kessler <Ke...@gmail.com>
Authored: Tue May 21 17:35:03 2013 -0400
Committer: Mark Kessler <Ke...@gmail.com>
Committed: Wed May 22 20:28:09 2013 -0400

----------------------------------------------------------------------
 .../framework/src/mx/managers/PopUpManagerImpl.as  |   23 ++++++++++----
 1 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0e48dac3/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as b/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as
index 2affd47..3cb569d 100644
--- a/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as
+++ b/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as
@@ -598,13 +598,22 @@ public class PopUpManagerImpl extends EventDispatcher implements IPopUpManager
                 const popUpLDE:ILayoutDirectionElement = popUp as ILayoutDirectionElement;
                 const parentLDE:ILayoutDirectionElement = popUpParent as ILayoutDirectionElement;
                 
-                if (popUpLDE &&
-                    ((parentLDE && parentLDE.layoutDirection != popUpLDE.layoutDirection) ||
-                        (!parentLDE && popUpLDE.layoutDirection == LayoutDirection.RTL)))
-                 {
-                        x = -x /* to flip it on the other side of the x axis*/ 
-                            -popUp.width /* because 0 is the right edge */;                            
-                 }
+                if (popUpLDE)
+                {
+                    if ((parentLDE && parentLDE.layoutDirection != popUpLDE.layoutDirection) ||
+                       (!parentLDE && popUpLDE.layoutDirection == LayoutDirection.RTL))
+                    {
+                        //(x = -x)  to flip it on the other side of the x axis.
+                        //(-popUp.width)  because 0 is the right edge.
+                        x = -x -popUp.width;
+                    }
+
+                    if (popUpLDE.layoutDirection == LayoutDirection.RTL)
+                    {
+                        //Corrects the x offset for RTL.
+                        clippingOffset.x += popUpParent.width;
+                    }
+                }
             }
             
             pt = new Point(clippingOffset.x, clippingOffset.y);