@meta2d/core 1.1.17 → 1.1.18

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.18",
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
  }
@@ -4006,6 +4006,7 @@ export class Canvas {
4006
4006
  const image64 = 'data:image/svg+xml;base64,' + svg64;
4007
4007
  // set that as your image source
4008
4008
  img.src = image64;
4009
+ img.crossOrigin = pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4009
4010
  // do your canvas work
4010
4011
  img.onload = () => {
4011
4012
  pen.calculative.img = img;
@@ -4049,7 +4050,7 @@ export class Canvas {
4049
4050
  img.crossOrigin =
4050
4051
  pen.crossOrigin === 'undefined'
4051
4052
  ? undefined
4052
- : pen.crossOrigin || 'anonymous';
4053
+ : pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4053
4054
  img.src = pen.image;
4054
4055
  if (this.store.options.cdn &&
4055
4056
  !(pen.image.startsWith('http') ||
@@ -4085,7 +4086,7 @@ export class Canvas {
4085
4086
  }
4086
4087
  else {
4087
4088
  const img = new Image();
4088
- img.crossOrigin = 'anonymous';
4089
+ img.crossOrigin = pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4089
4090
  img.src = pen.backgroundImage;
4090
4091
  if (this.store.options.cdn &&
4091
4092
  !(pen.backgroundImage.startsWith('http') ||
@@ -4115,7 +4116,7 @@ export class Canvas {
4115
4116
  }
4116
4117
  else {
4117
4118
  const img = new Image();
4118
- img.crossOrigin = 'anonymous';
4119
+ img.crossOrigin = pen.crossOrigin || this.store.options.crossOrigin || 'anonymous';
4119
4120
  img.src = pen.strokeImage;
4120
4121
  if (this.store.options.cdn &&
4121
4122
  !(pen.strokeImage.startsWith('http') ||
@@ -4147,7 +4148,7 @@ export class Canvas {
4147
4148
  const promise = new Promise((resolve, reject) => {
4148
4149
  if (!globalStore.htmlElements[src]) {
4149
4150
  const img = new Image();
4150
- img.crossOrigin = 'anonymous';
4151
+ img.crossOrigin = this.store.options.crossOrigin || 'anonymous';
4151
4152
  // 处理 CDN 路径
4152
4153
  if (this.store.options.cdn &&
4153
4154
  !(src.startsWith('http') ||