@meta2d/core 1.0.13 → 1.0.14
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 +20 -2
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.js +19 -9
- package/src/core.js.map +1 -1
- package/src/diagrams/gif.js +2 -4
- package/src/diagrams/gif.js.map +1 -1
- package/src/diagrams/iframe.js +1 -1
- package/src/diagrams/iframe.js.map +1 -1
- package/src/diagrams/video.js +1 -1
- package/src/diagrams/video.js.map +1 -1
- package/src/pen/model.d.ts +1 -0
- package/src/pen/model.js +1 -0
- package/src/pen/model.js.map +1 -1
- package/src/pen/render.js +49 -10
- package/src/pen/render.js.map +1 -1
- package/src/store/store.d.ts +1 -0
- package/src/store/store.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -2513,17 +2513,22 @@ var Canvas = /** @class */ (function () {
|
|
|
2513
2513
|
_this.store.emitter.emit('valueUpdate', pen);
|
|
2514
2514
|
};
|
|
2515
2515
|
this.canvasImageBottom = new CanvasImage(parentElement, store, true);
|
|
2516
|
+
this.canvasImageBottom.canvas.style.zIndex = '1';
|
|
2516
2517
|
parentElement.appendChild(this.canvas);
|
|
2517
2518
|
this.canvas.style.position = 'absolute';
|
|
2518
2519
|
this.canvas.style.backgroundRepeat = 'no-repeat';
|
|
2519
2520
|
this.canvas.style.backgroundSize = '100% 100%';
|
|
2521
|
+
this.canvas.style.zIndex = '2';
|
|
2520
2522
|
this.canvasImage = new CanvasImage(parentElement, store);
|
|
2523
|
+
this.canvasImage.canvas.style.zIndex = '3';
|
|
2521
2524
|
this.magnifierCanvas = new MagnifierCanvas(this, parentElement, store);
|
|
2525
|
+
this.magnifierCanvas.canvas.style.zIndex = '4';
|
|
2522
2526
|
this.externalElements.style.position = 'absolute';
|
|
2523
2527
|
this.externalElements.style.left = '0';
|
|
2524
2528
|
this.externalElements.style.top = '0';
|
|
2525
2529
|
this.externalElements.style.outline = 'none';
|
|
2526
2530
|
this.externalElements.style.background = 'transparent';
|
|
2531
|
+
this.externalElements.style.zIndex = '4';
|
|
2527
2532
|
parentElement.style.position = 'relative';
|
|
2528
2533
|
parentElement.appendChild(this.externalElements);
|
|
2529
2534
|
this.createInput();
|
|
@@ -2743,6 +2748,7 @@ var Canvas = /** @class */ (function () {
|
|
|
2743
2748
|
img.onerror = function (e) {
|
|
2744
2749
|
reject(e);
|
|
2745
2750
|
};
|
|
2751
|
+
img.crossOrigin = 'anonymous';
|
|
2746
2752
|
img.src = url;
|
|
2747
2753
|
})];
|
|
2748
2754
|
}
|
|
@@ -5225,7 +5231,8 @@ var Canvas = /** @class */ (function () {
|
|
|
5225
5231
|
});
|
|
5226
5232
|
Canvas.prototype.copy = function (pens) {
|
|
5227
5233
|
return __awaiter(this, void 0, void 0, function () {
|
|
5228
|
-
var page, _a, origin, scale, clipboard, _b;
|
|
5234
|
+
var page, _a, origin, scale, copyPens, clipboard, _b;
|
|
5235
|
+
var _this = this;
|
|
5229
5236
|
return __generator(this, function (_c) {
|
|
5230
5237
|
switch (_c.label) {
|
|
5231
5238
|
case 0:
|
|
@@ -5234,9 +5241,20 @@ var Canvas = /** @class */ (function () {
|
|
|
5234
5241
|
this.store.clipboard = undefined;
|
|
5235
5242
|
localStorage.removeItem(this.clipboardName);
|
|
5236
5243
|
sessionStorage.setItem('page', page);
|
|
5244
|
+
copyPens = this.getAllByPens(deepClone(pens || this.store.active, true));
|
|
5245
|
+
//根据pens顺序复制
|
|
5246
|
+
copyPens.forEach(function (activePen) {
|
|
5247
|
+
activePen.copyIndex = _this.store.data.pens.findIndex(function (pen) { return pen.id === activePen.id; });
|
|
5248
|
+
});
|
|
5249
|
+
copyPens.sort(function (a, b) {
|
|
5250
|
+
return a.copyIndex - b.copyIndex;
|
|
5251
|
+
});
|
|
5252
|
+
copyPens.forEach(function (activePen) {
|
|
5253
|
+
delete activePen.copyIndex;
|
|
5254
|
+
});
|
|
5237
5255
|
clipboard = {
|
|
5238
5256
|
meta2d: true,
|
|
5239
|
-
pens:
|
|
5257
|
+
pens: copyPens,
|
|
5240
5258
|
origin: deepClone(origin),
|
|
5241
5259
|
scale: scale,
|
|
5242
5260
|
page: page,
|