@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta2d/core",
3
- "version": "1.0.82",
3
+ "version": "1.0.83",
4
4
  "description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -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;