Repository: flex-sdk
Updated Branches:
  refs/heads/develop 1a15b4a51 -> f14dc1431


Fix for https://issues.apache.org/jira/browse/FLEX-34391
Ensure that StageText's viewport x/y values stay within the range 0 to 
stage.stageWidth or stage.stageHeight


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

Branch: refs/heads/develop
Commit: f14dc1431c1914a5e1fef6c77b67b23b9c41a7fd
Parents: 1a15b4a
Author: OmPrakash Muppirala <[email protected]>
Authored: Mon Feb 29 13:15:08 2016 -0800
Committer: OmPrakash Muppirala <[email protected]>
Committed: Mon Feb 29 13:15:08 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f14dc143/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 de6cff1..18006ac 100644
--- 
a/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ScrollableStageText.as
+++ 
b/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ScrollableStageText.as
@@ -1628,6 +1628,28 @@ public class ScrollableStageText extends UIComponent  
implements IStyleableEdita
         globalRect.y = Math.floor(Math.min(globalTopLeft.y, 
globalBottomRight.y));
         globalRect.width = Math.ceil(Math.abs(globalBottomRight.x - 
globalTopLeft.x));
         globalRect.height = Math.ceil(Math.abs(globalBottomRight.y - 
globalTopLeft.y));
+               
+               //StageText ViewPort's x and y should be in between -8192 and 
8191
+               //Reset x to min of x and stage.stageWidth
+               if(globalRect.x > 0)
+               {
+                       globalRect.x = Math.min(globalRect.x, 
stage.stageWidth);        
+               }
+               else
+               {
+                       globalRect.x = Math.max(globalRect.x, 0);
+               }
+               
+               //Reset y to min of y and stage.stageHeight
+               if(globalRect.y > 0)
+               {
+                       globalRect.y = Math.min(globalRect.y, 
stage.stageHeight);       
+               }
+               else
+               {
+                       globalRect.y = Math.max(globalRect.y, 0);
+               }
+               
 
         return globalRect;
     }

Reply via email to