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

carlosrovira 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 81da914  basic-styleduibase: conform to latest changes on UIBase 
setWidthAndHeight
81da914 is described below

commit 81da9144a45c37eb91b2b45c73dbeceb199e1580
Author: Carlos Rovira <carlosrov...@apache.org>
AuthorDate: Sun Mar 15 22:37:58 2020 +0100

    basic-styleduibase: conform to latest changes on UIBase setWidthAndHeight
---
 .../royale/org/apache/royale/core/StyledUIBase.as     | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
index 9af38f5..cc6bc01 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
@@ -310,27 +310,30 @@ package org.apache.royale.core
          */
         override public function setWidthAndHeight(newWidth:Number, 
newHeight:Number, noEvent:Boolean = false):void
         {
-            if (_width !== newWidth)
+            var widthChanged:Boolean = _width !== newWidth;
+                       var heightChanged:Boolean = _height !== newHeight;
+            if (widthChanged)
             {
                 _width = newWidth;
                 COMPILE::JS
                 {
                     this.positioner.style.width = isNaN(newWidth) ? null : 
newWidth.toString() + 'px';        
                 }
-                if (!noEvent) 
-                    sendEvent(this,"widthChanged");
+                if (!noEvent && !heightChanged) 
+                    sendEvent(this, "widthChanged");
             }
-            if (_height !== newHeight)
+            if (heightChanged)
             {
                 _height = newHeight;
                 COMPILE::JS
                 {
                     this.positioner.style.height = isNaN(newHeight) ? null : 
newHeight.toString() + 'px';        
                 }
-                if (!noEvent)
-                    sendEvent(this,"heightChanged");
-            }            
-            sendEvent(this,"sizeChanged");
+                if (!noEvent && !widthChanged)
+                    sendEvent(this, "heightChanged");
+            }
+            if (widthChanged && heightChanged)            
+                sendEvent(this, "sizeChanged");
         }
 
         /**

Reply via email to