This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit ed8999f3fc97d0ab422131358aa050ffc7c5c7cd Author: Alex Harui <[email protected]> AuthorDate: Thu Nov 26 18:33:07 2020 -0800 have dropdown check if sizedToContent and use the same measuredHeight as Flex did. Should fix #952 --- .../src/main/royale/spark/components/DropDownList.as | 6 ++++++ .../main/royale/spark/components/beads/DropDownListView.as | 8 +++++++- .../spark/components/supportClasses/DropDownListButton.as | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DropDownList.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DropDownList.as index fd18ee1..fd189b4 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DropDownList.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DropDownList.as @@ -333,6 +333,12 @@ public class DropDownList extends DropDownListBase } } */ + override protected function measure():void + { + measuredWidth = 112; + measuredHeight = 21; + } + /** * @private */ diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/DropDownListView.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/DropDownListView.as index 9e467ac..b862b7c 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/DropDownListView.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/beads/DropDownListView.as @@ -181,7 +181,13 @@ package spark.components.beads { var list:DropDownList = host as DropDownList; var view:DropDownListView = list.view as DropDownListView; - view.label.setActualSize(list.width, list.height); + var w:Number = list.width; + if (list.isWidthSizedToContent()) + w = list.measuredWidth; + var h:Number = list.height; + if (list.isHeightSizedToContent()) + h = list.measuredHeight; + view.label.setActualSize(w, h); return false; } diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as index e3bdd9f..420e1df 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as @@ -78,5 +78,17 @@ package spark.components.supportClasses (w - 17) + ',12 L ' + (w - 21) + ',5"</path></svg>'; } + + //-------------------------------------------------------------------------- + // + // Overridden methods + // + //-------------------------------------------------------------------------- + + override public function get measuredHeight():Number + { + return 21; // maybe measure font someday if fontSize is large + } + } } \ No newline at end of file
