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 0f1febb  It turns out natural width was necessary.
0f1febb is described below

commit 0f1febbd9cb8bfa75bda65c36b5e83d9fcc2af09
Author: DESKTOP-RH4S838\Yishay <[email protected]>
AuthorDate: Sat Apr 4 12:15:06 2020 +0300

    It turns out natural width was necessary.
    
    Reference #796
---
 frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as
index 1fdab2a..caf0801 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as
@@ -699,7 +699,7 @@ public class Button extends UIComponent implements 
IDataRenderer, IListItemRende
        private function handleImageLoaded2(event:BrowserEvent):void
        {
                var img:HTMLImageElement = event.target as HTMLImageElement;
-               element.style["text-indent"] = "4px";
+               element.style["text-indent"] = String(img.naturalWidth+4)+"px";
                
                this.height = Math.max(img.naturalHeight, element.offsetHeight);
                

Reply via email to