This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch feature/MXRoyale in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit d9a8dfb4c872b1a7c95ef8c835e58e4f10d8eee3 Author: Alex Harui <[email protected]> AuthorDate: Mon Aug 13 11:49:06 2018 -0700 get spark layout working --- .../MXRoyale/src/main/royale/mx/core/UIComponent.as | 4 ++-- .../src/main/royale/spark/layouts/HorizontalLayout.as | 15 ++++++++++++--- .../src/main/royale/spark/layouts/VerticalLayout.as | 15 ++++++++++++--- .../royale/spark/layouts/supportClasses/LayoutBase.as | 5 +++++ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as index 756460f..a47a151 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as @@ -1753,7 +1753,7 @@ public class UIComponent extends UIBase * @private * Storage for the measuredWidth property. */ - private var _measuredWidth:Number = Number.NaN; + protected var _measuredWidth:Number = Number.NaN; [Inspectable(environment="none")] @@ -1808,7 +1808,7 @@ public class UIComponent extends UIBase * @private * Storage for the measuredHeight property. */ - private var _measuredHeight:Number = Number.NaN; + protected var _measuredHeight:Number = Number.NaN; [Inspectable(environment="none")] diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as index c6a67ce..a77be15 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/HorizontalLayout.as @@ -859,9 +859,11 @@ public class HorizontalLayout extends LayoutBase _horizontalAlign = value; + /* var layoutTarget:GroupBase = target; if (layoutTarget) layoutTarget.invalidateDisplayList(); + */ } //---------------------------------- @@ -926,9 +928,11 @@ public class HorizontalLayout extends LayoutBase } else { + /* var layoutTarget:GroupBase = target; if (layoutTarget) layoutTarget.invalidateDisplayList(); + */ } } @@ -967,13 +971,14 @@ public class HorizontalLayout extends LayoutBase override public function set clipAndEnableScrolling(value:Boolean):void { super.clipAndEnableScrolling = value; + /* var hAlign:String = horizontalAlign; if (hAlign == HorizontalAlign.CENTER || hAlign == HorizontalAlign.RIGHT) { var g:GroupBase = target; if (g) g.invalidateDisplayList(); - } + }*/ } /** @@ -983,12 +988,14 @@ public class HorizontalLayout extends LayoutBase { llv = null; + /* var g:GroupBase = GroupBase(target); if (!g) return; target.invalidateSize(); target.invalidateDisplayList(); + */ } /** @@ -1243,13 +1250,13 @@ public class HorizontalLayout extends LayoutBase /* If the scrollRect is within the bounds of the elements, we do not need to call invalidateDisplayList(). This considerably speeds - up small scrolls. */ + up small scrolls. if (!firstElement || !lastElement || scrollRect.left < firstElement.getLayoutBoundsX() || scrollRect.right >= (lastElement.getLayoutBoundsX() + lastElement.getLayoutBoundsWidth())) { g.invalidateDisplayList(); - } + }*/ } setIndexInView(i0, i1); @@ -2370,12 +2377,14 @@ public class HorizontalLayout extends LayoutBase */ private function invalidateTargetSizeAndDisplayList():void { + /* var g:GroupBase = target; if (!g) return; g.invalidateSize(); g.invalidateDisplayList(); + */ } //-------------------------------------------------------------------------- diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as index 029ef8d..d56650a 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/VerticalLayout.as @@ -345,9 +345,11 @@ public class VerticalLayout extends LayoutBase _horizontalAlign = value; + /* var layoutTarget:GroupBase = target; if (layoutTarget) layoutTarget.invalidateDisplayList(); + */ } //---------------------------------- @@ -395,9 +397,11 @@ public class VerticalLayout extends LayoutBase _verticalAlign = value; + /* var layoutTarget:GroupBase = target; if (layoutTarget) layoutTarget.invalidateDisplayList(); + */ } //---------------------------------- @@ -919,13 +923,14 @@ public class VerticalLayout extends LayoutBase override public function set clipAndEnableScrolling(value:Boolean):void { super.clipAndEnableScrolling = value; + /* var vAlign:String = verticalAlign; if (vAlign == VerticalAlign.MIDDLE || vAlign == VerticalAlign.BOTTOM) { var g:GroupBase = target; if (g) g.invalidateDisplayList(); - } + }*/ } /** @@ -939,8 +944,10 @@ public class VerticalLayout extends LayoutBase if (!g) return; + /* target.invalidateSize(); target.invalidateDisplayList(); + */ } /** @@ -1197,13 +1204,13 @@ public class VerticalLayout extends LayoutBase /* If the scrollRect is within the bounds of the elements, we do not need to call invalidateDisplayList(). This considerably speeds - up small scrolls. */ + up small scrolls. if (!firstElement || !lastElement || scrollRect.top < firstElement.getLayoutBoundsY() || scrollRect.bottom >= (lastElement.getLayoutBoundsY() + lastElement.getLayoutBoundsHeight())) { g.invalidateDisplayList(); - } + }*/ } setIndexInView(i0, i1); @@ -2207,8 +2214,10 @@ public class VerticalLayout extends LayoutBase if (!g) return; + /* g.invalidateSize(); g.invalidateDisplayList(); + */ } //-------------------------------------------------------------------------- diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/LayoutBase.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/LayoutBase.as index 605117d..4f6d0c8 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/LayoutBase.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/LayoutBase.as @@ -30,6 +30,7 @@ import spark.components.supportClasses.GroupBase; //import spark.components.supportClasses.OverlayDepth; import spark.core.NavigationUnit; +import org.apache.royale.core.LayoutBase; import org.apache.royale.core.UIBase; import org.apache.royale.events.Event; import org.apache.royale.events.EventDispatcher; @@ -231,8 +232,10 @@ public class LayoutBase extends /*OnDemand*/EventDispatcher clearVirtualLayoutCache(); _useVirtualLayout = value; + /* if (target) target.invalidateDisplayList(); + */ } /** @@ -446,9 +449,11 @@ public class LayoutBase extends /*OnDemand*/EventDispatcher return; _typicalLayoutElement = value; + /* var g:GroupBase = target; if (g) g.invalidateSize(); + */ } //----------------------------------
