Add the style of right-angle grid-aligned wires in the graph (#2182)

* Verticle and horizontal lines achieved(#2170)

* vertical lines alligned with grid dots

* fixed vertical lines positioning

* Deals with cases 5 and 6

* Fixed case 5 and other problematic zones

* edge cases solved

* edge cases fixed: HorizontalOut & HorizontalIn

* added comments

* Changed midX and midY

* Clean up if/else statements

* Consolidate code

* Consolidate further

* Add preference for wire style

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Nitish Itankar
2025-02-13 07:58:43 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 2d90bb0cbf
commit 26fa8d967e
11 changed files with 393 additions and 58 deletions
@@ -41,6 +41,7 @@ export function createNodeGraphState(editor: Editor) {
addExport: undefined as { x: number; y: number } | undefined,
nodes: new Map<bigint, FrontendNode>(),
wires: [] as FrontendNodeWire[],
wiresDirectNotGridAligned: false,
wirePathInProgress: undefined as WirePath | undefined,
inputTypeDescriptions: new Map<string, string>(),
nodeDescriptions: new Map<string, string>(),
@@ -123,6 +124,7 @@ export function createNodeGraphState(editor: Editor) {
state.nodes.set(node.id, node);
});
state.wires = updateNodeGraph.wires;
state.wiresDirectNotGridAligned = updateNodeGraph.wiresDirectNotGridAligned;
return state;
});
});