modern-canvas 0.12.1 → 0.12.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
@@ -1,4 +1,4 @@
1
- import { defineProperty, Observable, Reactivable, parseColor, property, RawWeakMap as RawWeakMap$1, isGradient, isColorFillObject, clearUndef, idGenerator, normalizeFill, isNone, normalizeBackground, normalizeForeground, normalizeOutline, normalizeShadow, normalizeShape, getDefaultStyle, normalizeText, normalizeTextContent } from 'modern-idoc';
1
+ import { defineProperty, Observable, Reactivable, parseColor, property, RawWeakMap as RawWeakMap$1, isGradient, isColorFillObject, clearUndef, idGenerator, normalizeFill, isNone, normalizeBackground, normalizeForeground, normalizeOutline, normalizeShadow, normalizeShape, getDefaultStyle, normalizeText, normalizeTextContent, getDefaultTextStyle, getDefaultLayoutStyle } from 'modern-idoc';
2
2
  import { fonts } from 'modern-font';
3
3
  import { extend } from 'colord';
4
4
  import namesPlugin from 'colord/plugins/names';
@@ -10325,6 +10325,8 @@ var __decorateClass$e = (decorators, target, key, kind) => {
10325
10325
  result = (decorator(result)) || result;
10326
10326
  return result;
10327
10327
  };
10328
+ const layoutStyle = new Set(Object.keys(getDefaultLayoutStyle()));
10329
+ const textStyles = new Set(Object.keys(getDefaultTextStyle()));
10328
10330
  let BaseElement2D = class extends Node2D {
10329
10331
  size = new Vector2().on("update", () => {
10330
10332
  this.updateGlobalTransform();
@@ -10485,6 +10487,11 @@ let BaseElement2D = class extends Node2D {
10485
10487
  this.requestRedraw();
10486
10488
  break;
10487
10489
  }
10490
+ if (textStyles.has(key) || layoutStyle.has(key)) {
10491
+ if (this.text.isValid()) {
10492
+ this.text.update();
10493
+ }
10494
+ }
10488
10495
  }
10489
10496
  _process(delta) {
10490
10497
  this.foreground.updateFrameIndex();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.12.1",
4
+ "version": "0.12.2",
5
5
  "packageManager": "pnpm@10.18.1",
6
6
  "description": "A JavaScript WebGL rendering engine.",
7
7
  "author": "wxm",