@@ -14,7 +14,7 @@ import {
1414} from '../interfaces' ;
1515import { LayoutProperties } from '../interfaces/layout-properties' ;
1616import { Theme } from '../interfaces/theme' ;
17- import { getSelectedNode } from '../reactivity' ;
17+ import { setSelectNode } from '../reactivity' ;
1818import { ConnectionControllerType , NodeType } from '../types' ;
1919import { BaseNodeInfo } from '../types/base-node-info' ;
2020import { getRectNodeCssClasses } from './css-classes/rect-css-classes' ;
@@ -141,85 +141,85 @@ export class RectThumb<T extends BaseNodeInfo> extends Rect<T> {
141141 ) {
142142 const { x, y } = this . canvasApp . getPointerPositionInLocalSpace ( event ) ;
143143
144- const selectedNodeId = getSelectedNode ( ) ;
145- if ( selectedNodeId ) {
146- const selectedNode = this . canvasElements ?. get (
147- selectedNodeId . id
148- ) as unknown as INodeComponent < T > ;
149- if (
150- selectedNode &&
151- selectedNode . nodeType === NodeType . Connection &&
152- event &&
153- this . nodeComponent ?. connections &&
154- this . nodeComponent ?. connections . length > 0
155- ) {
156- const startConnections = this . nodeComponent . connections . filter (
157- ( connection ) => {
158- return (
159- connection . startNode &&
160- connection . startNode ?. id === this . nodeComponent ?. id &&
161- connection . id === selectedNode . id
162- ) ;
163- }
164- ) ;
165- if ( startConnections . length > 0 ) {
166- const connection = startConnections [ 0 ] ;
167-
168- console . log ( 'thumb 2 start' , x , y ) ;
169- if ( connection . connectionStartNodeThumb ) {
170- connection . startNode = undefined ;
171- connection . startNodeThumb = undefined ;
172-
173- this . initiateDraggingConnection (
174- connection . connectionStartNodeThumb ,
175- x ,
176- y
177- // xorg,
178- // yorg,
179- // rootX,
180- // rootY
181- ) ;
182- }
183- return true ;
184- }
144+ // const selectedNodeId = getSelectedNode();
145+ // if (selectedNodeId) {
146+ // const selectedNode = this.canvasElements?.get(
147+ // selectedNodeId.id
148+ // ) as unknown as INodeComponent<T>;
149+ // if (
150+ // selectedNode &&
151+ // selectedNode.nodeType === NodeType.Connection &&
152+ // event &&
153+ // this.nodeComponent?.connections &&
154+ // this.nodeComponent?.connections.length > 0
155+ // ) {
156+ // const startConnections = this.nodeComponent.connections.filter(
157+ // (connection) => {
158+ // return (
159+ // connection.startNode &&
160+ // connection.startNode?.id === this.nodeComponent?.id &&
161+ // connection.id === selectedNode.id
162+ // );
163+ // }
164+ // );
165+ // if (startConnections.length > 0) {
166+ // const connection = startConnections[0];
167+
168+ // console.log('thumb 2 start', x, y);
169+ // if (connection.connectionStartNodeThumb) {
170+ // connection.startNode = undefined;
171+ // connection.startNodeThumb = undefined;
172+
173+ // this.initiateDraggingConnection(
174+ // connection.connectionStartNodeThumb,
175+ // x,
176+ // y
177+ // // xorg,
178+ // // yorg,
179+ // // rootX,
180+ // // rootY
181+ // );
182+ // }
183+ // return true;
184+ // }
185185
186- const endConnections = this . nodeComponent . connections . filter (
187- ( connection ) => {
188- return (
189- connection . endNode &&
190- connection . endNode ?. id === this . nodeComponent ?. id &&
191- connection . id === selectedNode . id
192- ) ;
193- }
194- ) ;
195- if ( endConnections . length > 0 ) {
196- const connection = endConnections [ 0 ] ;
197-
198- console . log ( 'thumb 2 end' , x , y ) ;
199- if ( connection . connectionEndNodeThumb ) {
200- if ( connection . endNode ) {
201- connection . endNode . connections =
202- connection . endNode . connections . filter ( ( connection ) => {
203- return connection . id !== connection . id ;
204- } ) ;
205- }
206- connection . endNode = undefined ;
207- connection . endNodeThumb = undefined ;
208-
209- this . initiateDraggingConnection (
210- connection . connectionEndNodeThumb ,
211- x ,
212- y
213- // xorg,
214- // yorg,
215- // rootX,
216- // rootY
217- ) ;
218- }
219- return true ;
220- }
221- }
222- }
186+ // const endConnections = this.nodeComponent.connections.filter(
187+ // (connection) => {
188+ // return (
189+ // connection.endNode &&
190+ // connection.endNode?.id === this.nodeComponent?.id &&
191+ // connection.id === selectedNode.id
192+ // );
193+ // }
194+ // );
195+ // if (endConnections.length > 0) {
196+ // const connection = endConnections[0];
197+
198+ // console.log('thumb 2 end', x, y);
199+ // if (connection.connectionEndNodeThumb) {
200+ // if (connection.endNode) {
201+ // connection.endNode.connections =
202+ // connection.endNode.connections.filter((connection) => {
203+ // return connection.id !== connection.id;
204+ // });
205+ // }
206+ // connection.endNode = undefined;
207+ // connection.endNodeThumb = undefined;
208+
209+ // this.initiateDraggingConnection(
210+ // connection.connectionEndNodeThumb,
211+ // x,
212+ // y
213+ // // xorg,
214+ // // yorg,
215+ // // rootX,
216+ // // rootY
217+ // );
218+ // }
219+ // return true;
220+ // }
221+ // }
222+ // }
223223
224224 const curve = this . createStraightLineConnection
225225 ? new LineConnection < T > (
@@ -276,6 +276,11 @@ export class RectThumb<T extends BaseNodeInfo> extends Rect<T> {
276276 this . nodeComponent . thumbConnectors &&
277277 this . nodeComponent . thumbConnectors . length > 0
278278 ) {
279+ setSelectNode ( {
280+ id : curve . nodeComponent . id ,
281+ containerNode : curve . nodeComponent
282+ . containerNode as unknown as IRectNodeComponent < BaseNodeInfo > ,
283+ } ) ;
279284 const thumbConnector = this . nodeComponent . thumbConnectors . find (
280285 ( thumbConnector ) => {
281286 if (
0 commit comments