Skip to content

Commit 9e35dfe

Browse files
committed
draw a dot when dragging a connection to better visually represent the connection socket being dragged out...
1 parent 0c1f56f commit 9e35dfe

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Editor.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ export class Editor {
632632
protected drawConnectionPipes( ctx:CanvasRenderingContext2D, theConnectedOnes = true )
633633
{
634634
let connectioDirStrength = 50;
635+
let dotPos:Vector2Like|undefined;
635636

636637
//#region draw connections
637638
this.connections.forEach( connection=>{
@@ -692,6 +693,8 @@ export class Editor {
692693

693694
ctx.setLineDash([5, 5]);
694695
ctx.strokeStyle = connection.from.color;
696+
697+
dotPos = to;
695698
}
696699

697700

@@ -700,9 +703,16 @@ export class Editor {
700703
ctx.stroke();
701704
ctx.setLineDash([]);
702705

703-
})
704-
706+
});
705707
//#endregion
708+
709+
if( dotPos && this.selectedOutlet )
710+
{
711+
ctx.beginPath();
712+
ctx.arc(dotPos.x, dotPos.y, 5, 0, 2 * Math.PI); // Create a circle path.
713+
ctx.fillStyle = this.selectedOutlet.color;
714+
ctx.fill(); // Fill the circle.
715+
}
706716
}
707717

708718
/**

0 commit comments

Comments
 (0)