modern-canvas 0.27.7 → 0.27.8

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.js CHANGED
@@ -7580,7 +7580,22 @@ var X = class extends w {
7580
7580
  _resolveThemeColor(e) {
7581
7581
  return this._parent.tree?.resolveThemeColor(e) ?? e;
7582
7582
  }
7583
+ _resolveBaseThemeColors() {
7584
+ if (!this._parent.tree) return;
7585
+ let e = (e, t) => {
7586
+ if (e) for (let n of t) {
7587
+ let t = e[n];
7588
+ typeof t == "string" && t.charCodeAt(0) === 64 && (e[n] = this._resolveThemeColor(t));
7589
+ }
7590
+ };
7591
+ e(this.base.computedStyle, ["backgroundColor", "color"]);
7592
+ for (let t of this.base.paragraphs) {
7593
+ e(t.style, ["backgroundColor"]), e(t.computedStyle, ["backgroundColor", "color"]);
7594
+ for (let n of t.fragments) e(n.style, ["backgroundColor"]), e(n.computedStyle, ["backgroundColor", "color"]);
7595
+ }
7596
+ }
7583
7597
  _rasterTexture() {
7598
+ this._resolveBaseThemeColors();
7584
7599
  let e = Math.ceil(this.base.boundingBox.width), t = Math.ceil(this.base.boundingBox.height), n = ra, r = Math.floor((oa() - ia) / n);
7585
7600
  if (e <= r && t <= r) {
7586
7601
  this._releaseTiles();
@@ -48,6 +48,7 @@ export declare class Element2DText extends CoreObject implements NormalizedText
48
48
  update(): void;
49
49
  /** fragment 颜色的语义色 token(`@token`)→ 当前主题实际色;非 token 原样返回。 */
50
50
  protected _resolveThemeColor<T = any>(value: T): T | string;
51
+ protected _resolveBaseThemeColors(): void;
51
52
  protected _rasterTexture(): void;
52
53
  protected _renderTiles(width: number, height: number, pixelRatio: number, maxTile: number): void;
53
54
  protected _releaseTiles(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.27.7",
4
+ "version": "0.27.8",
5
5
  "packageManager": "pnpm@10.19.0",
6
6
  "description": "A JavaScript WebGL rendering engine. only the ESM.",
7
7
  "author": "wxm",