Defer SaveCachedPose node selection to ensure visual tree is ready

Co-authored-by: LoogLong <86428208+LoogLong@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-05 03:27:44 +00:00
parent e91dbffdd2
commit 164d065b05

View File

@ -810,12 +810,17 @@ public partial class AnimGraphViewer
else
AddLayerTab(targetLayer);
// Select and highlight the SaveCachedPose node in the target layer
if (_layerStates.TryGetValue(targetLayer, out var state) &&
state.NodeVisuals.TryGetValue(savePoseNode, out var visual))
// Select and highlight the SaveCachedPose node in the target layer.
// Use Dispatcher.BeginInvoke to ensure the visual tree is fully updated
// after the tab switch before attempting to select the node.
Dispatcher.BeginInvoke(() =>
{
SelectNode(savePoseNode, visual.border);
}
if (_layerStates.TryGetValue(targetLayer, out var state) &&
state.NodeVisuals.TryGetValue(savePoseNode, out var visual))
{
SelectNode(savePoseNode, visual.border);
}
});
}
/// <summary>