Sfoglia il codice sorgente

Handle cross-root reparenting.

When updating the scene for a window, moving a control to a different root should be the same as just removing the control.
Steven Kirk 6 anni fa
parent
commit
e126874c80

+ 1 - 1
src/Avalonia.Visuals/Rendering/SceneGraph/SceneBuilder.cs

@@ -51,7 +51,7 @@ namespace Avalonia.Rendering.SceneGraph
                 UpdateSize(scene);
             }
 
-            if (visual.VisualRoot != null)
+            if (visual.VisualRoot == scene.Root.Visual)
             {
                 if (node?.Parent != null &&
                     visual.VisualParent != null &&