@mhamz.01/easyflow-whiteboard 2.101.0 → 2.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fabric-arrow.d.ts","sourceRoot":"","sources":["../../src/lib/fabric-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAEvG,qBAAa,KAAM,SAAQ,IAAI;IAC7B,MAAM,CAAC,IAAI,SAAW;gBAIV,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG;IAInE,OAAO,CAAC,GAAG,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"fabric-arrow.d.ts","sourceRoot":"","sources":["../../src/lib/fabric-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAEvG,qBAAa,KAAM,SAAQ,IAAI;IAC7B,MAAM,CAAC,IAAI,SAAW;gBAIV,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG;IAInE,OAAO,CAAC,GAAG,EAAE,wBAAwB;IA6BrC;;;OAGG;IACH,QAAQ,CACN,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAC,EAC9F,CAAC,SAAS,MAAM,CAAC,GAAG,KAAK,EACzB,mBAAmB,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,mBAAmB;IAI9D;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC;CAU/C"}
|
package/dist/lib/fabric-arrow.js
CHANGED
|
@@ -11,8 +11,10 @@ export class Arrow extends Line {
|
|
|
11
11
|
const dx = p.x2 - p.x1;
|
|
12
12
|
const dy = p.y2 - p.y1;
|
|
13
13
|
const angle = Math.atan2(dy, dx);
|
|
14
|
-
|
|
15
|
-
const
|
|
14
|
+
// ← FIX: Scale arrowhead based on strokeWidth
|
|
15
|
+
const strokeWidth = this.strokeWidth || 2;
|
|
16
|
+
const headLength = 10 + strokeWidth * 2; // Base 10 + 2x stroke
|
|
17
|
+
const headWidth = 6 + strokeWidth * 1.5; // Base 6 + 1.5x stroke
|
|
16
18
|
ctx.save();
|
|
17
19
|
ctx.translate(p.x2, p.y2);
|
|
18
20
|
ctx.rotate(angle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fabric-bidirectional-arrow.d.ts","sourceRoot":"","sources":["../../src/lib/fabric-bidirectional-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,IAAI,EAEJ,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,QAAQ,CAAC;AAGhB,qBAAa,kBAAmB,SAAQ,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,YAAY,CAAC;IACzG,OAAgB,IAAI,SAAyB;IAEtC,QAAQ,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG;IAKnE,OAAgB,eAAe,WAAyC;IAExE,OAAO,CAAC,GAAG,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"fabric-bidirectional-arrow.d.ts","sourceRoot":"","sources":["../../src/lib/fabric-bidirectional-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,IAAI,EAEJ,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,QAAQ,CAAC;AAGhB,qBAAa,kBAAmB,SAAQ,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,YAAY,CAAC;IACzG,OAAgB,IAAI,SAAyB;IAEtC,QAAQ,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG;IAKnE,OAAgB,eAAe,WAAyC;IAExE,OAAO,CAAC,GAAG,EAAE,wBAAwB;IAwCrC,OAAO,CAAC,cAAc;IAStB;;;OAGG;IACM,QAAQ,CACf,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAC,EAC9F,CAAC,SAAS,MAAM,CAAC,GAAG,KAAK,EACzB,mBAAmB,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,mBAAmB;IAO9D;;;OAGG;WACa,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAStD"}
|
|
@@ -11,21 +11,31 @@ export class BidirectionalArrow extends Line {
|
|
|
11
11
|
const dx = p.x2 - p.x1;
|
|
12
12
|
const dy = p.y2 - p.y1;
|
|
13
13
|
const angle = Math.atan2(dy, dx);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// End Arrowhead
|
|
14
|
+
const strokeWidth = this.strokeWidth || 2;
|
|
15
|
+
const headLength = 10 + strokeWidth * 2;
|
|
16
|
+
const headWidth = 6 + strokeWidth * 1.5;
|
|
18
17
|
ctx.save();
|
|
18
|
+
// Right arrowhead
|
|
19
19
|
ctx.translate(p.x2, p.y2);
|
|
20
20
|
ctx.rotate(angle);
|
|
21
|
-
|
|
22
|
-
ctx.
|
|
23
|
-
|
|
24
|
-
ctx.
|
|
21
|
+
ctx.beginPath();
|
|
22
|
+
ctx.moveTo(0, 0);
|
|
23
|
+
ctx.lineTo(-headLength, headWidth / 2);
|
|
24
|
+
ctx.lineTo(-headLength, -headWidth / 2);
|
|
25
|
+
ctx.closePath();
|
|
26
|
+
ctx.fillStyle = this.stroke || "#000000";
|
|
27
|
+
ctx.fill();
|
|
28
|
+
// Left arrowhead
|
|
29
|
+
ctx.translate(-p.x2, -p.y2);
|
|
25
30
|
ctx.translate(p.x1, p.y1);
|
|
26
31
|
ctx.rotate(angle + Math.PI);
|
|
27
|
-
|
|
28
|
-
ctx.
|
|
32
|
+
ctx.beginPath();
|
|
33
|
+
ctx.moveTo(0, 0);
|
|
34
|
+
ctx.lineTo(-headLength, headWidth / 2);
|
|
35
|
+
ctx.lineTo(-headLength, -headWidth / 2);
|
|
36
|
+
ctx.closePath();
|
|
37
|
+
ctx.fillStyle = this.stroke || "#000000";
|
|
38
|
+
ctx.fill();
|
|
29
39
|
ctx.restore();
|
|
30
40
|
}
|
|
31
41
|
_drawArrowHead(ctx, size) {
|