You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/03/19 02:41:18 UTC

[37/50] [abbrv] git commit: [flex-sdk] [refs/heads/new_android_skins] - FIXED - FLEX-34145 Mobile Theme: TextInput with layoutDirection="rtl" becomes mirror on focus out.

FIXED - FLEX-34145 Mobile Theme: TextInput with layoutDirection="rtl" becomes mirror on focus out.


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

Branch: refs/heads/new_android_skins
Commit: 787addb60083d4384f2c92ef6e0fc2f395ca9e07
Parents: 6e87e4c
Author: mamsellem <ma...@systar.com>
Authored: Fri Mar 14 16:25:43 2014 +0100
Committer: mamsellem <ma...@systar.com>
Committed: Fri Mar 14 16:25:43 2014 +0100

----------------------------------------------------------------------
 .../supportClasses/ScrollableStageText.as       | 22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/787addb6/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ScrollableStageText.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ScrollableStageText.as b/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ScrollableStageText.as
index 789e869..becc9e6 100644
--- a/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ScrollableStageText.as
+++ b/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ScrollableStageText.as
@@ -1559,8 +1559,14 @@ public class ScrollableStageText extends UIComponent  implements IStyleableEdita
                 if (oldImageData)
                     oldImageData.dispose();
             }
+            if (layoutDirection == LayoutDirection.RTL) {
+                // if mirrored , cancel mirroring for the bitmap, as it's already is the right direction (generated by the OS)
+                const mirrorMatrix: Matrix = proxy.transform.matrix;
+                mirrorMatrix.a = -1;
+                mirrorMatrix.tx =  width;
+                proxy.transform.matrix = mirrorMatrix;
+            }
         }
-    }
 
     /** Dispose the proxy resources once it has been removed from the stage */
     protected function disposeProxy():void
@@ -1607,18 +1613,10 @@ public class ScrollableStageText extends UIComponent  implements IStyleableEdita
 
     protected function getGlobalViewPort():Rectangle
     {
-        // We calculate the parent's concatenated matrix to deal with
-        // issues in the runtime where the concatenated matrix of the
-        // parent is out of sync.  See SDK-31538.
-        var m:Matrix = MatrixUtil.getConcatenatedMatrix(parent, stage);
-        var globalTopLeft:Point = m.transformPoint(localViewPort.topLeft);
-
-        // Transform the bottom-right corner of the local rect
-        // instead of setting width/height to account for any
-        // transformations applied to ancestor objects.
-        var globalBottomRight:Point = m.transformPoint(localViewPort.bottomRight);
+         // global viewport was wrong when RTL, so now we use the parent transformation directly
+        var globalTopLeft:Point = parent.localToGlobal(localViewPort.topLeft);
+        var globalBottomRight:Point = parent.localToGlobal(localViewPort.bottomRight);
         var globalRect:Rectangle = new Rectangle();
-
         // StageText can't deal with upside-down or mirrored rectangles
         // or non-integer values. Fix those here.
         globalRect.x = Math.floor(Math.min(globalTopLeft.x, globalBottomRight.x));