@meta2d/core 1.0.88 → 1.0.89
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 +48 -27
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.d.ts +1 -0
- package/src/core.js +87 -19
- package/src/core.js.map +1 -1
- package/src/diagrams/iframe.js +13 -4
- package/src/diagrams/iframe.js.map +1 -1
- package/src/pen/model.d.ts +1 -1
- package/src/pen/render.js +47 -20
- package/src/pen/render.js.map +1 -1
- package/src/pen/text.js +36 -25
- package/src/pen/text.js.map +1 -1
- package/src/scroll/scroll.d.ts +4 -1
- package/src/scroll/scroll.js +81 -8
- package/src/scroll/scroll.js.map +1 -1
- package/src/utils/time.js +2 -1
- package/src/utils/time.js.map +1 -1
- package/src/utils/tool.d.ts +1 -0
- package/src/utils/tool.js +4 -0
- package/src/utils/tool.js.map +1 -0
- package/src/utils/url.d.ts +1 -1
- package/src/utils/url.js +36 -4
- package/src/utils/url.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -15,6 +15,7 @@ import { MagnifierCanvas } from './magnifierCanvas';
|
|
|
15
15
|
import { lockedError } from '../utils/error';
|
|
16
16
|
import { Dialog } from '../dialog';
|
|
17
17
|
import { setter } from '../utils/object';
|
|
18
|
+
import { isNumber } from '../utils/tool';
|
|
18
19
|
import { Title } from '../title';
|
|
19
20
|
import { CanvasTemplate } from './canvasTemplate';
|
|
20
21
|
import { getLinePoints } from '../diagrams/line';
|
|
@@ -4037,31 +4038,51 @@ export class Canvas {
|
|
|
4037
4038
|
pen.calculative.fontSize =
|
|
4038
4039
|
pen.fontSize * pen.calculative.worldRect.height;
|
|
4039
4040
|
}
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
pen.
|
|
4044
|
-
pen.
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
pen.
|
|
4050
|
-
pen.
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4041
|
+
if (isNumber(pen.iconSize)) {
|
|
4042
|
+
pen.calculative.iconSize = pen.iconSize * scale;
|
|
4043
|
+
}
|
|
4044
|
+
if (isNumber(pen.iconWidth)) {
|
|
4045
|
+
pen.calculative.iconWidth = pen.iconWidth * scale;
|
|
4046
|
+
}
|
|
4047
|
+
if (isNumber(pen.iconHeight)) {
|
|
4048
|
+
pen.calculative.iconHeight = pen.iconHeight * scale;
|
|
4049
|
+
}
|
|
4050
|
+
if (isNumber(pen.iconLeft)) {
|
|
4051
|
+
pen.calculative.iconLeft =
|
|
4052
|
+
pen.iconLeft < 1 && pen.iconLeft > -1
|
|
4053
|
+
? pen.iconLeft
|
|
4054
|
+
: pen.iconLeft * scale;
|
|
4055
|
+
}
|
|
4056
|
+
if (isNumber(pen.iconTop)) {
|
|
4057
|
+
pen.calculative.iconTop =
|
|
4058
|
+
pen.iconTop < 1 && pen.iconTop > -1 ? pen.iconTop : pen.iconTop * scale;
|
|
4059
|
+
}
|
|
4060
|
+
if (isNumber(pen.textWidth)) {
|
|
4061
|
+
pen.calculative.textWidth =
|
|
4062
|
+
pen.textWidth < 1 && pen.textWidth > -1
|
|
4063
|
+
? pen.textWidth
|
|
4064
|
+
: pen.textWidth * scale;
|
|
4065
|
+
}
|
|
4066
|
+
if (isNumber(pen.textHeight)) {
|
|
4067
|
+
pen.calculative.textHeight =
|
|
4068
|
+
pen.textHeight < 1 && pen.textHeight > -1
|
|
4069
|
+
? pen.textHeight
|
|
4070
|
+
: pen.textHeight * scale;
|
|
4071
|
+
}
|
|
4072
|
+
if (isNumber(pen.textLeft)) {
|
|
4073
|
+
pen.calculative.textLeft =
|
|
4074
|
+
pen.textLeft < 1 && pen.textLeft > -1
|
|
4075
|
+
? pen.textLeft * pen.calculative.worldRect.width
|
|
4076
|
+
: pen.textLeft * scale;
|
|
4077
|
+
}
|
|
4078
|
+
if (isNumber(pen.textTop)) {
|
|
4079
|
+
pen.calculative.textTop =
|
|
4080
|
+
pen.textTop < 1 && pen.textTop > -1 ? pen.textTop * pen.calculative.worldRect.height : pen.textTop * scale;
|
|
4081
|
+
}
|
|
4082
|
+
if (isNumber(pen.borderWidth)) {
|
|
4083
|
+
if (pen.type === PenType.Line && pen.borderWidth) {
|
|
4084
|
+
pen.calculative.borderWidth = pen.borderWidth * scale;
|
|
4085
|
+
}
|
|
4065
4086
|
}
|
|
4066
4087
|
}
|
|
4067
4088
|
updatePenRect(pen, { worldRectIsReady, playingAnimate, } = {}) {
|
|
@@ -6596,7 +6617,7 @@ export class Canvas {
|
|
|
6596
6617
|
this.store.emitter.emit('change', pen);
|
|
6597
6618
|
this.store.emitter.emit('valueUpdate', pen);
|
|
6598
6619
|
}
|
|
6599
|
-
else if (pen.text === this.inputDiv.dataset.value && pen.calculative.textLines.length == 0) {
|
|
6620
|
+
else if (pen.text === this.inputDiv.dataset.value && pen.calculative.textLines && pen.calculative.textLines.length == 0) {
|
|
6600
6621
|
calcTextRect(pen);
|
|
6601
6622
|
}
|
|
6602
6623
|
this.initTemplateCanvas([pen]);
|
|
@@ -7018,7 +7039,7 @@ export class Canvas {
|
|
|
7018
7039
|
this.updatePenRect(pen);
|
|
7019
7040
|
}
|
|
7020
7041
|
else {
|
|
7021
|
-
willCalcTextRect && calcTextRect(pen);
|
|
7042
|
+
!pen.hiddenText && willCalcTextRect && calcTextRect(pen);
|
|
7022
7043
|
willCalcIconRect && calcIconRect(this.store.pens, pen);
|
|
7023
7044
|
if (willUpdatePath) {
|
|
7024
7045
|
globalStore.path2dDraws[pen.name] &&
|