@meta2d/core 1.0.75 → 1.0.77

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.75",
3
+ "version": "1.0.77",
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",
@@ -5819,8 +5819,14 @@ export class Canvas {
5819
5819
  const curPage = sessionStorage.getItem('page');
5820
5820
  const scale = this.store.data.scale;
5821
5821
  if (this.store.clipboard.mousePos && (Math.abs(this.store.clipboard.mousePos.x - this.mousePos.x) > 100 * scale || Math.abs(this.store.clipboard.mousePos.y - this.mousePos.y) > 100 * scale)) {
5822
- const offsetX = (scale - this.store.clipboard.scale) * this.store.clipboard.initRect.width / 2;
5823
- const offsetY = (scale - this.store.clipboard.scale) * this.store.clipboard.initRect.height / 2;
5822
+ let _x = -this.store.clipboard.initRect.width / this.store.clipboard.scale / 10 / (scale);
5823
+ let _y = -this.store.clipboard.initRect.height / this.store.clipboard.scale / 10 / (scale);
5824
+ let offsetX = (scale - this.store.clipboard.scale) * this.store.clipboard.initRect.width / 2 + _x;
5825
+ let offsetY = (scale - this.store.clipboard.scale) * this.store.clipboard.initRect.height / 2 + _y;
5826
+ if (this.store.clipboard.pens.length > 1) {
5827
+ offsetX = (scale - 1) * this.store.clipboard.initRect.width / this.store.clipboard.scale / 2;
5828
+ offsetY = (scale - 1) * this.store.clipboard.initRect.height / this.store.clipboard.scale / 2;
5829
+ }
5824
5830
  this.store.clipboard.pos = { x: this.mousePos.x - offsetX, y: this.mousePos.y - offsetY };
5825
5831
  this.store.clipboard.offset = 0;
5826
5832
  }
@@ -6893,7 +6899,7 @@ export class Canvas {
6893
6899
  if (needCalcIconRectProps.includes(k)) {
6894
6900
  willCalcIconRect = true;
6895
6901
  }
6896
- if (pen.image && pen.name !== 'gif' && ['globalAlpha', 'flipY', 'flipX', 'x', 'y', 'width', 'height', 'iconWidth', 'iconHeight', 'imageRatio', 'iconLeft', 'iconTop', 'iconAlign', 'rotate'].includes(k)) {
6902
+ if (pen.image && pen.name !== 'gif' && ['globalAlpha', 'flipY', 'flipX', 'x', 'y', 'width', 'height', 'iconWidth', 'iconHeight', 'imageRatio', 'iconLeft', 'iconTop', 'iconAlign', 'rotate', 'visible'].includes(k)) {
6897
6903
  willRenderImage = true;
6898
6904
  }
6899
6905
  }
@@ -7409,6 +7415,7 @@ export class Canvas {
7409
7415
  this.externalElements.style.zIndex = '5';
7410
7416
  this.magnifierCanvas.magnifier = false;
7411
7417
  this.externalElements.style.cursor = 'default';
7418
+ this.magnifierCanvas.render();
7412
7419
  this.render();
7413
7420
  }
7414
7421
  inFitBorder = (pt) => {