From f839b61455ee3b9113e23f73e40b37f10fa4cda8 Mon Sep 17 00:00:00 2001 From: xiaoiver Date: Sat, 14 Dec 2024 22:03:21 +0800 Subject: [PATCH] chore: lint --- packages/core/src/utils/glyph/tiny-sdf.ts | 2 +- packages/site/docs/index.md | 9 +++++++++ packages/site/docs/zh/index.md | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/core/src/utils/glyph/tiny-sdf.ts b/packages/core/src/utils/glyph/tiny-sdf.ts index da18ff3..37e2273 100644 --- a/packages/core/src/utils/glyph/tiny-sdf.ts +++ b/packages/core/src/utils/glyph/tiny-sdf.ts @@ -52,7 +52,7 @@ export class TinySDF { const ctx = $offscreenCanvas.getContext('2d', { willReadFrequently: true, - }); + }) as CanvasRenderingContext2D; this.ctx = ctx; ctx.font = `${fontStyle} ${fontWeight} ${fontSize}px ${fontFamily}`; diff --git a/packages/site/docs/index.md b/packages/site/docs/index.md index 4e5f703..9d59c4e 100644 --- a/packages/site/docs/index.md +++ b/packages/site/docs/index.md @@ -44,6 +44,7 @@ call(() => { RoughRect, RoughPolyline, RoughPath, + Text, deserializeNode, fromSVGElement, TesselationMethod, @@ -204,6 +205,14 @@ call(() => { canvas.appendChild(group); } }); + + const text = new Text({ + x: 300, + y: 500, + content: 'Hello, world!', + fontSize: 20, + }); + canvas.appendChild(text); }); $icCanvas.addEventListener('ic-frame', (e) => { diff --git a/packages/site/docs/zh/index.md b/packages/site/docs/zh/index.md index b8bb049..89575ba 100644 --- a/packages/site/docs/zh/index.md +++ b/packages/site/docs/zh/index.md @@ -44,6 +44,7 @@ call(() => { RoughRect, RoughPolyline, RoughPath, + Text, deserializeNode, fromSVGElement, TesselationMethod, @@ -204,6 +205,14 @@ call(() => { canvas.appendChild(group); } }); + + const text = new Text({ + x: 300, + y: 500, + content: 'Hello, world!', + fontSize: 20, + }); + canvas.appendChild(text); }); $icCanvas.addEventListener('ic-frame', (e) => {