make it possible to pan editor when rmb down on node

This commit is contained in:
xxSeys1
2024-09-14 15:33:07 +02:00
parent 49eeb7bf9a
commit 0a516ac98d

View File

@@ -146,6 +146,8 @@ namespace FlaxEditor.Surface
/// </summary>
protected virtual Color FooterColor => GroupArchetype.Color;
private Float2 mouseDownMousePosition;
/// <summary>
/// Calculates the size of the node including header, footer, and margins.
/// </summary>
@@ -1093,7 +1095,7 @@ namespace FlaxEditor.Surface
if (button == MouseButton.Left && (Archetype.Flags & NodeFlags.NoCloseButton) == 0 && _closeButtonRect.Contains(ref location))
return true;
if (button == MouseButton.Right)
return true;
mouseDownMousePosition = Input.Mouse.Position;
return false;
}
@@ -1114,6 +1116,9 @@ namespace FlaxEditor.Surface
// Secondary Context Menu
if (button == MouseButton.Right)
{
if (mouseDownMousePosition != Input.Mouse.Position)
return true;
if (!IsSelected)
Surface.Select(this);
var tmp = PointToParent(ref location);