[NUI] Enable relayout only when layout is set for the layer.
authorjoogab.yun <joogab.yun@samsung.com>
Tue, 6 Feb 2024 07:02:08 +0000 (16:02 +0900)
committerJoogabYun <40262755+JoogabYun@users.noreply.github.com>
Tue, 13 Feb 2024 07:22:57 +0000 (16:22 +0900)
If you do not check this, all views on layers that do not have a layout set will be searched unnecessarily.

src/Tizen.NUI/src/internal/Layouting/LayoutController.cs

index e4c2872..66c3c92 100755 (executable)
@@ -126,13 +126,16 @@ namespace Tizen.NUI
         {
             window.LayersChildren?.ForEach(layer =>
             {
-                layer?.Children?.ForEach(view =>
+                if(layer?.LayoutCount > 0)
                 {
-                    if (view != null)
+                    layer?.Children?.ForEach(view =>
                     {
-                        FindRootLayouts(view, windowWidth, windowHeight);
-                    }
-                });
+                        if (view != null)
+                        {
+                            FindRootLayouts(view, windowWidth, windowHeight);
+                        }
+                    });
+                }
             });
 
             transitionManager.SetupCoreAndPlayAnimation();