You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/01/14 09:27:16 UTC

[royale-asjs] 10/10: in JS, make child visible before setting size so the layout can get valid sizes. This and prior commits fix #366

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

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit ae770b55427e3b62d49ae7112f5175bdefbcda80
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Jan 14 01:24:56 2019 -0800

    in JS, make child visible before setting size so the layout can get valid sizes.  This and prior commits fix #366
---
 .../MXRoyale/src/main/royale/mx/containers/ViewStack.as   | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
index 74f1364..99cef43 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
@@ -986,15 +986,24 @@ public class ViewStack extends Container implements /*IHistoryManagerClient,*/ I
                     newHeight = child.explicitHeight;
             }
 
+            COMPILE::JS
+            {
+                // must set visible=true otherwise child has display:none
+                // and measurements of its children will not be correct
+                child.visible = true;
+            }
             // Don't send events for the size/move. The set visible below
             if (child.width != newWidth || child.height != newHeight)
                 child.setActualSize(newWidth, newHeight);
             if (child.x != left || child.y != top)
                 child.move(left, top);
 
-            // Now that the child is properly sized and positioned it
-            // can be shown.
-            child.visible = true;
+            COMPILE::SWF
+            {
+                // Now that the child is properly sized and positioned it
+                // can be shown.
+                child.visible = true;
+            }
         }
     }