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

harbs 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 5f94de8  Measure (especially height) properly for Spark Label when 
width is explicitly set (wrapping occurs only when width/percentWidth is 
explicitly set and style lineBreak != explicit).
     new 706e0cd  Merge pull request #988 from 
estanglerbm/sparklabel-measurewrapheight
5f94de8 is described below

commit 5f94de81a6284097f082eac807bb14cea4e92ac9
Author: Edward Stangler <[email protected]>
AuthorDate: Mon Dec 7 07:26:45 2020 -0600

    Measure (especially height) properly for Spark Label when width is 
explicitly set (wrapping occurs only when width/percentWidth is explicitly set 
and style lineBreak != explicit).
---
 .../projects/SparkRoyale/src/main/royale/spark/components/Label.as  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Label.as 
b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Label.as
index 78e2108..ef7f740 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Label.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Label.as
@@ -1709,7 +1709,8 @@ public class Label extends TextBase
     {
         //when measuring, turn off wrapping
         var oldValue:String = element.style.whiteSpace;
-        element.style.whiteSpace = "nowrap";
+        if ((isNaN(explicitWidth) && isNaN(percentWidth)) || 
getStyle("lineBreak") == "explicit")
+               element.style.whiteSpace = "nowrap";
         var mw:Number = super.measuredWidth;
         element.style.whiteSpace = oldValue;
         return mw + 1;
@@ -1720,7 +1721,8 @@ public class Label extends TextBase
     {
         //when measuring, turn off wrapping
         var oldValue:String = element.style.whiteSpace;
-        element.style.whiteSpace = "nowrap";
+        if ((isNaN(explicitWidth) && isNaN(percentWidth)) || 
getStyle("lineBreak") == "explicit")
+               element.style.whiteSpace = "nowrap";
         var mh:Number = super.measuredHeight;
         element.style.whiteSpace = oldValue;
         return mh;

Reply via email to