Skip to content

Commit d60ce9c

Browse files
authored
Merge pull request #17 from webfiltered/patch-1
Fix crash when connecting links
2 parents af1a90b + 75a0714 commit d60ce9c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

js/QuickConnection.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ export class QuickConnection {
198198
return;
199199
}
200200

201-
ctx.save();
202-
this.canvas.ds.toCanvasContext(ctx);
203-
204201
this.insideConnection = null;
205202

206203
const connectionInfo = this.getCurrentConnection();
@@ -209,6 +206,13 @@ export class QuickConnection {
209206
const {
210207
node, input, output, slot,
211208
} = connectionInfo;
209+
if (!input && !output) {
210+
return;
211+
}
212+
213+
ctx.save();
214+
this.canvas.ds.toCanvasContext(ctx);
215+
212216
const slotPos = new Float32Array(2);
213217

214218
const isInput = input ? true : false;
@@ -436,7 +440,7 @@ export class QuickConnection {
436440

437441
ctx.font = oldFont;
438442
}
439-
}
440443
ctx.restore();
444+
}
441445
}
442446
}

0 commit comments

Comments
 (0)