modern-canvas 0.7.1 → 0.7.2

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
@@ -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.2",
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",