瀏覽代碼

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 年之前
父節點
當前提交
e126874c80
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Avalonia.Visuals/Rendering/SceneGraph/SceneBuilder.cs

+ 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 &&