Fix Editor UI tree control click to handle selection update before

#533
This commit is contained in:
Wojtek Figat
2021-05-28 12:09:26 +02:00
parent 77f9010b06
commit 94ee82b58d
2 changed files with 14 additions and 6 deletions

View File

@@ -723,12 +723,6 @@ namespace FlaxEditor.GUI.Tree
/// <inheritdoc />
public override bool OnMouseUp(Vector2 location, MouseButton button)
{
// Check if mouse hits bar
if (button == MouseButton.Right && TestHeaderHit(ref location))
{
ParentTree.OnRightClickInternal(this, ref location);
}
// Clear flag for left button
if (button == MouseButton.Left)
{
@@ -773,11 +767,23 @@ namespace FlaxEditor.GUI.Tree
Expand();
}
// Check if mouse hits bar
if (button == MouseButton.Right && TestHeaderHit(ref location))
{
ParentTree.OnRightClickInternal(this, ref location);
}
// Handled
Focus();
return true;
}
// Check if mouse hits bar
if (button == MouseButton.Right && TestHeaderHit(ref location))
{
ParentTree.OnRightClickInternal(this, ref location);
}
// Base
return base.OnMouseUp(location, button);
}

View File

@@ -41,6 +41,8 @@ namespace FlaxEditor.Windows.Assets
var newRoot = Object.Find<Actor>(ref newRootId);
_window.Graph.MainActor = null;
_window.Viewport.Instance = null;
if (SceneGraphFactory.Nodes.TryGetValue(oldRootId, out var oldRootNode))
oldRootNode.Dispose();
if (SceneGraphFactory.Nodes.TryGetValue(newRootId, out var newRootNode))