You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2022/06/30 10:55:51 UTC

[royale-asjs] branch develop updated: Emulation - Resize - take into account effect starting again before it has finished

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 22ea30b047 Emulation - Resize - take into account effect starting again before it has finished
     new fab8230c9e Merge branch 'develop' of https://github.com/apache/royale-asjs into develop
22ea30b047 is described below

commit 22ea30b047f6676729b96f0f6367a402cb57993c
Author: yweiss <yi...@mcafee.com>
AuthorDate: Thu Jun 30 03:47:07 2022 -0700

    Emulation - Resize - take into account effect starting again before it has finished
---
 .../MXRoyale/src/main/royale/mx/effects/Resize.as      | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/effects/Resize.as b/frameworks/projects/MXRoyale/src/main/royale/mx/effects/Resize.as
index a634717df8..8f97634cfa 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/effects/Resize.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/effects/Resize.as
@@ -57,20 +57,34 @@ public class Resize extends org.apache.royale.effects.Resize
 
     private var _originalHeightBy:Number;
     private var _originalWidthBy:Number;
+    private var _started:Boolean;
     /**
      *  @private
      *  Store values that might change by parent class
      */
     override public function play():void
     {
-        _originalHeightBy = heightBy;
-        _originalWidthBy = widthBy;
+        if (_started)
+        {
+            resetValues();
+        } else 
+        {
+            _originalHeightBy = heightBy;
+            _originalWidthBy = widthBy;
+            _started = true;
+        }
         super.play();
     }
 
     override public function onTweenEnd(value:Number):void
     {
         super.onTweenEnd(value);
+        resetValues();
+        _started = false;
+    }
+
+    private function resetValues():void
+    {
         // These public properties may have been internally changed by parent class
         // TODO refactor mx effects to use mx tween
         heightBy = _originalHeightBy;