This is an automated email from the ASF dual-hosted git repository.
pent pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/feature/MXRoyale by this push:
new a2d6305 Clean up of layout code.
a2d6305 is described below
commit a2d630557a006526e565d699812681369812184a
Author: Peter Ent <[email protected]>
AuthorDate: Tue Mar 20 17:04:44 2018 -0400
Clean up of layout code.
---
.../mx/containers/beads/ApplicationLayout.as | 6 ++----
.../main/royale/mx/containers/beads/BoxLayout.as | 25 +++++++++++-----------
2 files changed, 14 insertions(+), 17 deletions(-)
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/ApplicationLayout.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/ApplicationLayout.as
index 6f9df72..ec53b20 100644
---
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/ApplicationLayout.as
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/ApplicationLayout.as
@@ -66,9 +66,9 @@ public class ApplicationLayout extends BoxLayout
* Lay out children as per Application layout rules.
*/
override public function updateDisplayList(unscaledWidth:Number,
-
unscaledHeight:Number):Boolean
+
unscaledHeight:Number):void
{
- if (!super.updateDisplayList(unscaledWidth, unscaledHeight))
return false;
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
var target:Container = super.target;
@@ -106,8 +106,6 @@ public class ApplicationLayout extends BoxLayout
}
}
}
-
- return true;
}
}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
index 77c9e2b..94492bd 100644
---
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
@@ -191,16 +191,18 @@ package mx.containers.beads
override public function layout():Boolean
{
- var testWidth:Number =
target.getExplicitOrMeasuredWidth();
- var testHeight:Number =
target.getExplicitOrMeasuredHeight();
- trace("Before layout: width="+testWidth+";
height="+testHeight);
- if (updateDisplayList(target.width, target.height)) {
- testWidth = target.getExplicitOrMeasuredWidth();
- testHeight =
target.getExplicitOrMeasuredHeight();
- //??? target.setActualSize(testWidth, testHeight);
- trace("After layout: width="+target.width+";
height="+target.height);
+ var n:int = target.numChildren;
+ if (n == 0)
+ return false;
+ updateDisplayList(target.width, target.height);
+
+ // update the target's actual size if needed.
+ if (target.isWidthSizedToContent() ||
target.isHeightSizedToContent()) {
+
target.setActualSize(target.getExplicitOrMeasuredWidth(),
+
target.getExplicitOrMeasuredHeight());
}
+
return true;
}
@@ -209,11 +211,10 @@ package mx.containers.beads
* Lay out children as per Box layout rules.
*/
public function updateDisplayList(unscaledWidth:Number,
-
unscaledHeight:Number):Boolean
+
unscaledHeight:Number):void
{
var n:int = target.numChildren;
- if (n == 0)
- return false;
+ if (n == 0) return;
var vm:EdgeMetrics = target.viewMetricsAndPadding;
@@ -395,8 +396,6 @@ package mx.containers.beads
}
}
}
-
- return true;
}
//--------------------------------------------------------------------------
--
To stop receiving notification emails like this one, please contact
[email protected].