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

yishayw 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 87780dd  Make sure label is measured after it changes.
87780dd is described below

commit 87780dd4b8f511650fcfa05ba07c3a0e5ef321bf
Author: DESKTOP-RH4S838\Yishay <[email protected]>
AuthorDate: Fri Apr 3 19:44:23 2020 +0300

    Make sure label is measured after it changes.
    
    Closes #790
---
 .../projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
index 5ce610b..2d65f17 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
@@ -26,6 +26,8 @@ COMPILE::JS
     import org.apache.royale.html.supportClasses.RadioButtonIcon;
     import org.apache.royale.html.util.addElementToWrapper;
 }
+import org.apache.royale.core.ILayoutChild;
+import org.apache.royale.events.IEventDispatcher;
 import org.apache.royale.events.Event;
 /*
 import flash.events.Event;
@@ -306,6 +308,10 @@ public class RadioButton extends Button
     override public function set label(value:String):void
     {
         textNode.innerText = value;
+        if (this.parent is ILayoutChild && (this.parent as 
ILayoutChild).isWidthSizedToContent())
+        {
+            (this.parent as IEventDispatcher).dispatchEvent(new 
Event("layoutNeeded"));
+        }
     }
     
     /**
@@ -523,8 +529,7 @@ public class RadioButton extends Button
     {
                COMPILE::JS
                {
-                       // Safari seems to like 6
-                       var ww:Number = rbicon.element.offsetWidth + 
textNode.offsetWidth + 6;
+                       var ww:Number = rbicon.element.offsetWidth + 
textNode.offsetWidth + 8;
                        return ww;
                }
         // on Safari, we seem to come up one pixel short sometimes

Reply via email to