@meta2d/core 1.0.19 → 1.0.20

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.19",
3
+ "version": "1.0.20",
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",
@@ -246,6 +246,10 @@ var Canvas = /** @class */ (function () {
246
246
  }
247
247
  e.preventDefault();
248
248
  e.stopPropagation();
249
+ //移动画笔过程中不允许缩放
250
+ if (_this.mouseDown &&
251
+ (_this.hoverType === HoverType.Node || _this.hoverType === HoverType.Line))
252
+ return;
249
253
  if (_this.store.data.locked === LockState.Disable)
250
254
  return;
251
255
  if (_this.store.data.locked === LockState.DisableScale)
@@ -2853,6 +2857,10 @@ var Canvas = /** @class */ (function () {
2853
2857
  pen.height *= this.store.data.scale;
2854
2858
  pen.x = e.x - pen.width / 2;
2855
2859
  pen.y = e.y - pen.height / 2;
2860
+ if (pen.tags && pen.tags.includes('meta3d')) {
2861
+ pen.x = this.store.data.origin.x;
2862
+ pen.y = this.store.data.origin.y;
2863
+ }
2856
2864
  }
2857
2865
  }
2858
2866
  }
@@ -2883,7 +2891,11 @@ var Canvas = /** @class */ (function () {
2883
2891
  { x: pen.x, y: pen.y + pen.height },
2884
2892
  { x: pen.x + pen.width, y: pen.y + pen.height },
2885
2893
  ];
2886
- if (points.some(function (point) { return pointInRect(point, rect_1); })) {
2894
+ if ((pen.x === rect_1.x &&
2895
+ pen.y === rect_1.y &&
2896
+ pen.width === rect_1.width &&
2897
+ pen.height === rect_1.height) ||
2898
+ points.some(function (point) { return pointInRect(point, rect_1); })) {
2887
2899
  flag = false;
2888
2900
  break;
2889
2901
  }
@@ -4009,7 +4021,7 @@ var Canvas = /** @class */ (function () {
4009
4021
  };
4010
4022
  Canvas.prototype.loadImage = function (pen) {
4011
4023
  var _this = this;
4012
- if (pen.image !== pen.calculative.image) {
4024
+ if (pen.image !== pen.calculative.image || !pen.calculative.img) {
4013
4025
  pen.calculative.img = undefined;
4014
4026
  if (pen.image) {
4015
4027
  if (globalStore.htmlElements[pen.image]) {