@meta2d/core 1.0.85 → 1.0.87
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.
- package/package.json +1 -1
- package/src/canvas/canvas.js +7 -1
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.d.ts +2 -0
- package/src/core.js +137 -44
- package/src/core.js.map +1 -1
- package/src/options.d.ts +1 -0
- package/src/options.js.map +1 -1
- package/src/pen/math.d.ts +1 -0
- package/src/pen/math.js +21 -0
- package/src/pen/math.js.map +1 -1
- package/src/pen/model.d.ts +7 -0
- package/src/pen/model.js +13 -1
- package/src/pen/model.js.map +1 -1
- package/src/pen/render.js +25 -3
- package/src/pen/render.js.map +1 -1
- package/src/pen/text.js +1 -1
- package/src/pen/text.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -1295,7 +1295,7 @@ export class Canvas {
|
|
|
1295
1295
|
if (this.beforeAddPen && this.beforeAddPen(pen) != true) {
|
|
1296
1296
|
continue;
|
|
1297
1297
|
}
|
|
1298
|
-
if (abs) {
|
|
1298
|
+
if (abs && !pen.parentId) {
|
|
1299
1299
|
pen.x = pen.x * this.store.data.scale + this.store.data.origin.x;
|
|
1300
1300
|
pen.y = pen.y * this.store.data.scale + this.store.data.origin.y;
|
|
1301
1301
|
pen.width = pen.width * this.store.data.scale;
|
|
@@ -1514,10 +1514,12 @@ export class Canvas {
|
|
|
1514
1514
|
active: true,
|
|
1515
1515
|
worldAnchors: [pt],
|
|
1516
1516
|
lineWidth: lineWidth * scale,
|
|
1517
|
+
...options.linePresetStyle
|
|
1517
1518
|
},
|
|
1518
1519
|
fromArrow: data.fromArrow || options.fromArrow,
|
|
1519
1520
|
toArrow: data.toArrow || options.toArrow,
|
|
1520
1521
|
lineWidth,
|
|
1522
|
+
...options.linePresetStyle
|
|
1521
1523
|
};
|
|
1522
1524
|
}
|
|
1523
1525
|
onMouseDown = (e) => {
|
|
@@ -4023,6 +4025,7 @@ export class Canvas {
|
|
|
4023
4025
|
const scale = this.store.data.scale;
|
|
4024
4026
|
pen.calculative.lineWidth = pen.lineWidth * scale;
|
|
4025
4027
|
pen.calculative.fontSize = pen.fontSize * scale;
|
|
4028
|
+
pen.calculative.letterSpacing = (pen.letterSpacing || 0) * scale;
|
|
4026
4029
|
if (pen.fontSize < 1 && pen.fontSize > 0) {
|
|
4027
4030
|
pen.calculative.fontSize =
|
|
4028
4031
|
pen.fontSize * pen.calculative.worldRect.height;
|
|
@@ -6472,6 +6475,9 @@ export class Canvas {
|
|
|
6472
6475
|
}
|
|
6473
6476
|
style += `height:${height}px;`;
|
|
6474
6477
|
}
|
|
6478
|
+
if (pen.letterSpacing) {
|
|
6479
|
+
style += `letter-spacing:${pen.calculative.letterSpacing}px;`;
|
|
6480
|
+
}
|
|
6475
6481
|
let _textWidth = null;
|
|
6476
6482
|
if (pen.textWidth) {
|
|
6477
6483
|
_textWidth =
|