4 magladore!

This commit is contained in:
Chromium 2025-05-03 07:23:00 +01:00
parent 8d629e5cd3
commit b1e0767d91
3 changed files with 16 additions and 4 deletions

View File

@ -83,7 +83,7 @@ namespace ImageProcessingGraph.Editor
AssetDatabase.Refresh(); AssetDatabase.Refresh();
} }
public List<(BaseImageNode node, System.Type type)> GetAllVariableNodesWithTypes() public List<(BaseImageNode node, System.Type type)> GetAllVariableNodesWithTypes()
{ {
var result = new List<(BaseImageNode node, System.Type type)>(); var result = new List<(BaseImageNode node, System.Type type)>();

View File

@ -26,9 +26,12 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
public void OnDropOutsidePort(Edge edge, Vector2 position) public void OnDropOutsidePort(Edge edge, Vector2 position)
{ {
window.searchProvider.target = (VisualElement)window.focusController.focusedElement; window.searchProvider.target = (VisualElement)window.focusController.focusedElement;
var mousePos =
window.ChangeCoordinatesTo(window, window.cachedMousePos - window.Window.position.position);
var graphMousePosition = window.contentViewContainer.WorldToLocal(mousePos);
// ⚡ Override the search window open with a customized search tree SearchWindow.Open(new SearchWindowContext(GUIUtility.GUIToScreenPoint(Event.current.mousePosition)), new ImageProcessingGraphSearchProvider.CustomSearchProviderForEdge(window.searchProvider, edge, (IPTPort)edge.input, (IPTPort)edge.output));
SearchWindow.Open(new SearchWindowContext(position), new ImageProcessingGraphSearchProvider.CustomSearchProviderForEdge(window.searchProvider, edge, (IPTPort)edge.input, (IPTPort)edge.output));
// Remove connections as you did // Remove connections as you did
List<GraphConnection> connections = new List<GraphConnection>(); List<GraphConnection> connections = new List<GraphConnection>();

View File

@ -27,6 +27,8 @@ namespace ImageProcessingGraph.Editor
internal ImageProcessingGraphEdgeConnectorListener edgeConnectorListener; internal ImageProcessingGraphEdgeConnectorListener edgeConnectorListener;
private bool isDropdownEnabled = false; private bool isDropdownEnabled = false;
public Vector2 cachedMousePos;
private Button debugModeButton; private Button debugModeButton;
private Button outputRunOrder; private Button outputRunOrder;
@ -76,8 +78,15 @@ namespace ImageProcessingGraph.Editor
graphViewChanged += OnGraphViewChanged; graphViewChanged += OnGraphViewChanged;
Undo.undoRedoPerformed += UndoRedoPerformed; Undo.undoRedoPerformed += UndoRedoPerformed;
RegisterCallback<MouseMoveEvent>(OnMouseMove);
} }
private void OnMouseMove(MouseMoveEvent evt)
{
cachedMousePos = evt.localMousePosition;
}
private void UndoRedoPerformed() private void UndoRedoPerformed()
{ {
DrawNodes(); DrawNodes();