@meta2d/core 1.0.60 → 1.0.61
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 +17 -5
- package/src/canvas/canvas.js.map +1 -1
- package/src/canvas/magnifierCanvas.d.ts +2 -0
- package/src/canvas/magnifierCanvas.js +21 -0
- package/src/canvas/magnifierCanvas.js.map +1 -1
- package/src/core.d.ts +6 -1
- package/src/core.js +249 -62
- package/src/core.js.map +1 -1
- package/src/dialog/dialog.js +2 -2
- package/src/dialog/dialog.js.map +1 -1
- package/src/event/event.d.ts +5 -0
- package/src/event/event.js.map +1 -1
- package/src/pen/model.d.ts +5 -0
- package/src/pen/model.js.map +1 -1
- package/src/pen/render.js +58 -11
- package/src/pen/render.js.map +1 -1
- package/src/store/store.d.ts +4 -1
- package/src/store/store.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -126,13 +126,13 @@ export class Canvas {
|
|
|
126
126
|
this.canvasImage = new CanvasImage(parentElement, store);
|
|
127
127
|
this.canvasImage.canvas.style.zIndex = '4';
|
|
128
128
|
this.magnifierCanvas = new MagnifierCanvas(this, parentElement, store);
|
|
129
|
-
this.magnifierCanvas.canvas.style.zIndex = '
|
|
129
|
+
this.magnifierCanvas.canvas.style.zIndex = '100'; //放大镜盖过dom图元
|
|
130
130
|
this.externalElements.style.position = 'absolute';
|
|
131
131
|
this.externalElements.style.left = '0';
|
|
132
132
|
this.externalElements.style.top = '0';
|
|
133
133
|
this.externalElements.style.outline = 'none';
|
|
134
134
|
this.externalElements.style.background = 'transparent';
|
|
135
|
-
this.externalElements.style.zIndex = '
|
|
135
|
+
this.externalElements.style.zIndex = '101';
|
|
136
136
|
parentElement.style.position = 'relative';
|
|
137
137
|
parentElement.appendChild(this.externalElements);
|
|
138
138
|
this.createInput();
|
|
@@ -353,7 +353,7 @@ export class Canvas {
|
|
|
353
353
|
}
|
|
354
354
|
let data = JSON.parse(e.data);
|
|
355
355
|
if (typeof data === 'object') {
|
|
356
|
-
this.parent.doMessageEvent(data.name);
|
|
356
|
+
this.parent.doMessageEvent(data.name, data.value);
|
|
357
357
|
}
|
|
358
358
|
else {
|
|
359
359
|
this.parent.doMessageEvent(data);
|
|
@@ -6133,7 +6133,7 @@ export class Canvas {
|
|
|
6133
6133
|
textRect.x + this.store.data.x - (pen.textLeft || 0) + 'px'; //+ 5
|
|
6134
6134
|
this.inputParent.style.top =
|
|
6135
6135
|
textRect.y + this.store.data.y - (pen.textTop || 0) + 'px'; //+ 5
|
|
6136
|
-
let _width = textRect.width
|
|
6136
|
+
let _width = textRect.width; //+ (pen.textLeft || 0);
|
|
6137
6137
|
this.inputParent.style.width = (_width < 0 ? 12 : _width) + 'px'; //(textRect.width < pen.width ? 0 : 10)
|
|
6138
6138
|
this.inputParent.style.height = textRect.height + (pen.textTop || 0) + 'px'; // (textRect.height < pen.height ? 0 : 10)
|
|
6139
6139
|
this.inputParent.style.zIndex = '9999';
|
|
@@ -6152,6 +6152,8 @@ export class Canvas {
|
|
|
6152
6152
|
if (!this.store.data.locked) {
|
|
6153
6153
|
this.inputRight.style.display = 'none';
|
|
6154
6154
|
}
|
|
6155
|
+
this.dropdown.style.background = pen.dropdownBackground || '#fff';
|
|
6156
|
+
this.dropdown.style.color = pen.dropdownColor || '#bdc7db';
|
|
6155
6157
|
this.setDropdownList();
|
|
6156
6158
|
}
|
|
6157
6159
|
else {
|
|
@@ -6357,7 +6359,7 @@ export class Canvas {
|
|
|
6357
6359
|
pen.text = this.inputDiv.dataset.value;
|
|
6358
6360
|
pen.calculative.text = pen.text;
|
|
6359
6361
|
this.inputDiv.dataset.penId = undefined;
|
|
6360
|
-
if (pen.
|
|
6362
|
+
if (pen.text && pen.textAutoAdjust) {
|
|
6361
6363
|
calcTextAutoWidth(pen);
|
|
6362
6364
|
}
|
|
6363
6365
|
calcTextRect(pen);
|
|
@@ -6597,6 +6599,15 @@ export class Canvas {
|
|
|
6597
6599
|
li.onmousedown = this.stopPropagation;
|
|
6598
6600
|
li.dataset.i = index + '';
|
|
6599
6601
|
li.onclick = this.selectDropdown;
|
|
6602
|
+
const pen = this.store.pens[this.inputDiv.dataset.penId];
|
|
6603
|
+
li.onmouseenter = () => {
|
|
6604
|
+
li.style.background = pen.dropdownHoverBackground || '#eee';
|
|
6605
|
+
li.style.color = pen.dropdownHoverColor || '#bdc7db';
|
|
6606
|
+
};
|
|
6607
|
+
li.onmouseleave = () => {
|
|
6608
|
+
li.style.background = pen.dropdownBackground || '#fff';
|
|
6609
|
+
li.style.color = pen.dropdownColor || '#bdc7db';
|
|
6610
|
+
};
|
|
6600
6611
|
this.dropdown.appendChild(li);
|
|
6601
6612
|
}
|
|
6602
6613
|
selectDropdown = (e) => {
|
|
@@ -7211,6 +7222,7 @@ export class Canvas {
|
|
|
7211
7222
|
}
|
|
7212
7223
|
showMagnifier() {
|
|
7213
7224
|
this.magnifierCanvas.magnifier = true;
|
|
7225
|
+
this.magnifierCanvas.updateDomOffscreen();
|
|
7214
7226
|
this.externalElements.style.cursor = 'default';
|
|
7215
7227
|
this.render();
|
|
7216
7228
|
}
|