@meta2d/core 1.1.17 → 1.1.19

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.1.17",
3
+ "version": "1.1.19",
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",
@@ -1094,7 +1094,7 @@ export class Canvas {
1094
1094
  img.onerror = (e) => {
1095
1095
  reject(e);
1096
1096
  };
1097
- img.crossOrigin = 'anonymous';
1097
+ img.crossOrigin = this.store.options.crossOrigin || 'anonymous';
1098
1098
  img.src = url;
1099
1099
  });
1100
1100
  }
@@ -1961,6 +1961,15 @@ export class Canvas {
1961
1961
  if (this.mouseRight === MouseRight.Down) {
1962
1962
  this.mouseRight = MouseRight.Translate;
1963
1963
  }
1964
+ const activePen = this.store.active[0];
1965
+ if (activePen &&
1966
+ this.store.data.locked &&
1967
+ (activePen.locked === undefined ||
1968
+ activePen.locked < LockState.DisableMove)) {
1969
+ // 图元鼠标按下后移动交互
1970
+ activePen?.onMouseMove?.(activePen, this.mousePos);
1971
+ return;
1972
+ }
1964
1973
  // Translate
1965
1974
  if (this.store.data.locked === LockState.DisableEdit ||
1966
1975
  this.store.data.locked === LockState.DisableScale ||
@@ -4006,6 +4015,7 @@ export class Canvas {
4006
4015
  const image64 = 'data:image/svg+xml;base64,' + svg64;
4007
4016
  // set that as your image source
4008
4017
  img.src = image64;
4018
+ img.crossOrigin = pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4009
4019
  // do your canvas work
4010
4020
  img.onload = () => {
4011
4021
  pen.calculative.img = img;
@@ -4049,7 +4059,7 @@ export class Canvas {
4049
4059
  img.crossOrigin =
4050
4060
  pen.crossOrigin === 'undefined'
4051
4061
  ? undefined
4052
- : pen.crossOrigin || 'anonymous';
4062
+ : pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4053
4063
  img.src = pen.image;
4054
4064
  if (this.store.options.cdn &&
4055
4065
  !(pen.image.startsWith('http') ||
@@ -4085,7 +4095,7 @@ export class Canvas {
4085
4095
  }
4086
4096
  else {
4087
4097
  const img = new Image();
4088
- img.crossOrigin = 'anonymous';
4098
+ img.crossOrigin = pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4089
4099
  img.src = pen.backgroundImage;
4090
4100
  if (this.store.options.cdn &&
4091
4101
  !(pen.backgroundImage.startsWith('http') ||
@@ -4115,7 +4125,7 @@ export class Canvas {
4115
4125
  }
4116
4126
  else {
4117
4127
  const img = new Image();
4118
- img.crossOrigin = 'anonymous';
4128
+ img.crossOrigin = pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4119
4129
  img.src = pen.strokeImage;
4120
4130
  if (this.store.options.cdn &&
4121
4131
  !(pen.strokeImage.startsWith('http') ||
@@ -4147,7 +4157,7 @@ export class Canvas {
4147
4157
  const promise = new Promise((resolve, reject) => {
4148
4158
  if (!globalStore.htmlElements[src]) {
4149
4159
  const img = new Image();
4150
- img.crossOrigin = 'anonymous';
4160
+ img.crossOrigin = this.store.options.crossOrigin || 'anonymous';
4151
4161
  // 处理 CDN 路径
4152
4162
  if (this.store.options.cdn &&
4153
4163
  !(src.startsWith('http') ||