This commit is contained in:
2024-12-18 22:27:27 +01:00
parent 6af27de3dd
commit a892e1fcb2
4 changed files with 126 additions and 18 deletions

View File

@@ -101,13 +101,13 @@ export const connections = function(superClass) {
const canvasRect = this.canvas.getBoundingClientRect();
const start = {
x: sourceRect.left + sourceRect.width/2 - canvasRect.left,
y: sourceRect.top + sourceRect.height/2 - canvasRect.top
x: (sourceRect.left + sourceRect.width/2 - canvasRect.left) / this.scale,
y: (sourceRect.top + sourceRect.height/2 - canvasRect.top) / this.scale
};
const end = {
x: this.mousePosition.x - canvasRect.left,
y: this.mousePosition.y - canvasRect.top
x: (this.mousePosition.x - canvasRect.left) / this.scale,
y: (this.mousePosition.y - canvasRect.top) / this.scale
};
const controlPoint1 = {
@@ -150,13 +150,13 @@ export const connections = function(superClass) {
const canvasRect = this.canvas.getBoundingClientRect();
const start = {
x: sourceRect.left + sourceRect.width/2 - canvasRect.left,
y: sourceRect.top + sourceRect.height/2 - canvasRect.top
x: (sourceRect.left + sourceRect.width/2 - canvasRect.left) / this.scale,
y: (sourceRect.top + sourceRect.height/2 - canvasRect.top) / this.scale
};
const end = {
x: targetRect.left + targetRect.width/2 - canvasRect.left,
y: targetRect.top + targetRect.height/2 - canvasRect.top
x: (targetRect.left + targetRect.width/2 - canvasRect.left) / this.scale,
y: (targetRect.top + targetRect.height/2 - canvasRect.top) / this.scale
};
const controlPoint1 = {