@meta2d/core 1.0.82 → 1.0.83
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 +6 -1
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.d.ts +3 -0
- package/src/core.js +130 -39
- package/src/core.js.map +1 -1
- package/src/diagrams/video.js +1 -0
- package/src/diagrams/video.js.map +1 -1
- package/src/store/global.d.ts +1 -1
- package/src/store/store.d.ts +8 -2
- package/src/store/store.js.map +1 -1
- package/src/utils/clone.js +1 -1
- package/src/utils/clone.js.map +1 -1
- package/src/utils/time.d.ts +1 -1
- package/src/utils/time.js +5 -2
- package/src/utils/time.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -4548,11 +4548,11 @@ export class Canvas {
|
|
|
4548
4548
|
}
|
|
4549
4549
|
scalePoint(this.store.data.origin, s, center);
|
|
4550
4550
|
this.store.data.pens.forEach((pen) => {
|
|
4551
|
+
pen.onScale && pen.onScale(pen);
|
|
4551
4552
|
if (pen.parentId) {
|
|
4552
4553
|
return;
|
|
4553
4554
|
}
|
|
4554
4555
|
scalePen(pen, s, center);
|
|
4555
|
-
pen.onScale && pen.onScale(pen);
|
|
4556
4556
|
if (pen.isRuleLine) {
|
|
4557
4557
|
// 扩大线的比例,若是放大,即不缩小,若是缩小,会放大
|
|
4558
4558
|
const lineScale = 1 / s; //s > 1 ? 1 : 1 / s / s;
|
|
@@ -5873,6 +5873,11 @@ export class Canvas {
|
|
|
5873
5873
|
let _y = -this.store.clipboard.initRect.height / this.store.clipboard.scale / 10 / (scale);
|
|
5874
5874
|
let offsetX = (scale - this.store.clipboard.scale) * this.store.clipboard.initRect.width / 2 + _x;
|
|
5875
5875
|
let offsetY = (scale - this.store.clipboard.scale) * this.store.clipboard.initRect.height / 2 + _y;
|
|
5876
|
+
if (scale < this.store.clipboard.scale) {
|
|
5877
|
+
// 减小粘贴偏移量
|
|
5878
|
+
offsetX = (scale - this.store.clipboard.scale) / ((this.store.clipboard.scale - scale) * 100) * this.store.clipboard.initRect.width / 2 + _x;
|
|
5879
|
+
offsetY = (scale - this.store.clipboard.scale) / ((this.store.clipboard.scale - scale) * 100) * this.store.clipboard.initRect.height / 2 + _y;
|
|
5880
|
+
}
|
|
5876
5881
|
if (this.store.clipboard.pens.length > 1) {
|
|
5877
5882
|
offsetX = (scale - 1) * this.store.clipboard.initRect.width / this.store.clipboard.scale / 2;
|
|
5878
5883
|
offsetY = (scale - 1) * this.store.clipboard.initRect.height / this.store.clipboard.scale / 2;
|