modern-canvas 0.7.1 → 0.7.3

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/dist/index.mjs CHANGED
@@ -6159,20 +6159,20 @@ __decorateClass$S([
6159
6159
  property({ fallback: idGenerator() })
6160
6160
  ], Node.prototype, "name", 2);
6161
6161
  __decorateClass$S([
6162
- property({ fallback: "inherit" })
6162
+ property({ default: () => ({}) })
6163
+ ], Node.prototype, "meta", 2);
6164
+ __decorateClass$S([
6165
+ property({ protected: true, fallback: "inherit" })
6163
6166
  ], Node.prototype, "processMode", 2);
6164
6167
  __decorateClass$S([
6165
- property({ fallback: "default" })
6168
+ property({ protected: true, fallback: "default" })
6166
6169
  ], Node.prototype, "processSortMode", 2);
6167
6170
  __decorateClass$S([
6168
- property({ fallback: "inherit" })
6171
+ property({ protected: true, fallback: "inherit" })
6169
6172
  ], Node.prototype, "renderMode", 2);
6170
6173
  __decorateClass$S([
6171
- property({ fallback: "default" })
6174
+ property({ protected: true, fallback: "default" })
6172
6175
  ], Node.prototype, "internalMode", 2);
6173
- __decorateClass$S([
6174
- property({ default: () => ({}) })
6175
- ], Node.prototype, "meta", 2);
6176
6176
  __decorateClass$S([
6177
6177
  property({ protected: true })
6178
6178
  ], Node.prototype, "mask", 2);
@@ -9306,6 +9306,14 @@ class BaseElement2DBackground extends BaseElement2DFill {
9306
9306
  isNone(properties) ? void 0 : normalizeBackground(properties)
9307
9307
  );
9308
9308
  }
9309
+ _updateProperty(key, value, oldValue, declaration) {
9310
+ super._updateProperty(key, value, oldValue, declaration);
9311
+ switch (key) {
9312
+ case "fillWithShape":
9313
+ this.parent.requestRedraw();
9314
+ break;
9315
+ }
9316
+ }
9309
9317
  }
9310
9318
  __decorateClass$r([
9311
9319
  property()
@@ -9326,6 +9334,14 @@ class BaseElement2DForeground extends BaseElement2DFill {
9326
9334
  isNone(properties) ? void 0 : normalizeForeground(properties)
9327
9335
  );
9328
9336
  }
9337
+ _updateProperty(key, value, oldValue, declaration) {
9338
+ super._updateProperty(key, value, oldValue, declaration);
9339
+ switch (key) {
9340
+ case "fillWithShape":
9341
+ this.parent.requestRedraw();
9342
+ break;
9343
+ }
9344
+ }
9329
9345
  }
9330
9346
  __decorateClass$q([
9331
9347
  property()
@@ -9933,7 +9949,11 @@ let BaseElement2D = class extends Node2D {
9933
9949
  }
9934
9950
  if (this._background.canDraw()) {
9935
9951
  this._tree?.log(this.name, "background drawing");
9936
- this._shape.drawRect();
9952
+ if (this._background.fillWithShape) {
9953
+ this._shape.draw();
9954
+ } else {
9955
+ this._shape.drawRect();
9956
+ }
9937
9957
  this._background.draw();
9938
9958
  }
9939
9959
  if (this._fill.canDraw()) {
@@ -9948,7 +9968,11 @@ let BaseElement2D = class extends Node2D {
9948
9968
  }
9949
9969
  if (this._foreground.canDraw()) {
9950
9970
  this._tree?.log(this.name, "foreground drawing");
9951
- this._shape.drawRect();
9971
+ if (this._foreground.fillWithShape) {
9972
+ this._shape.draw();
9973
+ } else {
9974
+ this._shape.drawRect();
9975
+ }
9952
9976
  this._foreground.draw();
9953
9977
  }
9954
9978
  if (this._text.canDraw()) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.7.1",
4
+ "version": "0.7.3",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "A JavaScript WebGL rendering engine.",
7
7
  "author": "wxm",
@@ -72,16 +72,16 @@
72
72
  "modern-font": "^0.4.1",
73
73
  "modern-idoc": "^0.8.6",
74
74
  "modern-path2d": "^1.4.5",
75
- "modern-text": "^1.7.1",
75
+ "modern-text": "^1.7.2",
76
76
  "yoga-layout": "^3.2.1"
77
77
  },
78
78
  "devDependencies": {
79
- "@antfu/eslint-config": "^4.16.2",
79
+ "@antfu/eslint-config": "^4.17.0",
80
80
  "@types/earcut": "^3.0.0",
81
81
  "@types/node": "^24.0.13",
82
82
  "bumpp": "^10.2.0",
83
83
  "conventional-changelog-cli": "^5.0.0",
84
- "eslint": "^9.30.1",
84
+ "eslint": "^9.31.0",
85
85
  "lint-staged": "^16.1.2",
86
86
  "lottie-web": "^5.13.0",
87
87
  "modern-gif": "^2.0.4",