Skip to content

Commit

Permalink
feat: improve benchmark example
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Jul 9, 2024
1 parent 4d9351c commit 4f633a8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/gem-examples/src/benchmark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,14 @@ export class App extends GemElement<State> {
() => html`<canvas ref=${this.canvasRef.ref} width=${width / ratio} height=${height / ratio}></canvas>`,
)}
<div class="grid">
${this.#pixelsPosition.map((index) => {
const color = pixels.slice(index, index + 4) as unknown as RGBA;
return html`<app-pixel ratio=${ratio} color=${rgbToRgbColor(color)}></app-pixel>`;
})}
${repeat(
this.#pixelsPosition,
(_, i) => i,
(index) => {
const color = pixels.slice(index, index + 4) as unknown as RGBA;
return html`<app-pixel ratio=${ratio} color=${rgbToRgbColor(color)}></app-pixel>`;
},
)}
</div>
`;
}
Expand Down

0 comments on commit 4f633a8

Please sign in to comment.