You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2020/12/19 12:38:43 UTC

[royale-asjs] branch develop updated: Change Spark Scroller to allow viewport to be set after Scroller is added to its parent.

This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3ac4c32  Change Spark Scroller to allow viewport to be set after Scroller is added to its parent.
     new f8d680f  Merge pull request #1018 from estanglerbm/sparkscroller-viewport
3ac4c32 is described below

commit 3ac4c3291a244ad6808a1757fbffd8671d27be8d
Author: Edward Stangler <es...@bradmark.com>
AuthorDate: Wed Dec 9 20:15:41 2020 -0600

    Change Spark Scroller to allow viewport to be set after Scroller is added to its parent.
---
 .../src/main/royale/spark/components/Scroller.as           | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Scroller.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Scroller.as
index 3330ecd..0cd296e 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Scroller.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Scroller.as
@@ -1116,6 +1116,15 @@ public class Scroller extends SkinnableComponent
      */
     private function installViewport():void
     {
+        if (!viewport) return;
+        
+    		// moved from addedToParent()
+		var vp:UIComponent = _viewport as UIComponent;
+		if (vp.isWidthSizedToContent())
+        		vp.setWidth(width);
+		if (vp.isHeightSizedToContent())
+        		vp.setHeight(height);
+
         /*  SWF?
         if (skin && viewport)
         {*/
@@ -3895,11 +3904,6 @@ public class Scroller extends SkinnableComponent
     override public function addedToParent():void
     {
         super.addedToParent();
-		var vp:UIComponent = _viewport as UIComponent;
-		if (vp.isWidthSizedToContent())
-        		vp.setWidth(width);
-		if (vp.isHeightSizedToContent())
-        		vp.setHeight(height);
         installViewport();
     }