Skip to content

Commit

Permalink
chore: use clientonly component for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoiver committed Jan 18, 2025
1 parent 95d4590 commit 8098f77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/utils/glyph/sdf-esdt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ const paintIntoStage = (
inner.fill(0, 0, np);

// const getData = (x: number, y: number) => data[y * w + x] ?? 0;
// const getData = (x: number, y: number) => data[4 * (y * w + x) + 3] ?? 0;
const getData = (x: number, y: number) =>
(data[4 * (y * w + x) + 3] ?? 0) / 255;
const getData = (x: number, y: number) => data[4 * (y * w + x) + 3] ?? 0;
// const getData = (x: number, y: number) =>
// (data[4 * (y * w + x) + 3] ?? 0) / 255;

for (let y = 0; y < h; y++) {
for (let x = 0; x < w; x++) {
const a = getData(x, y);
if (!a) continue;

const i = (y + pad) * wp + x + pad;
if (a >= 254 / 255) {
if (a >= 254) {
// Fix for bad rasterizer rounding
data[4 * (y * w + x) + 3] = 255;

Expand Down
4 changes: 3 additions & 1 deletion packages/site/docs/components/PythagoreanTheorem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ const Demo = () => {
defineRender(() => {
return (
<App>
<Demo />
<ClientOnly>
<Demo />
</ClientOnly>
</App>
);
});
Expand Down

0 comments on commit 8098f77

Please sign in to comment.