refactor(renderer): extract artboard checkerboard drawing

This commit is contained in:
syntaxbullet
2026-07-03 09:56:03 +02:00
parent 3d32e8fbef
commit fb0c424745
7 changed files with 75 additions and 26 deletions

7
renderer/clear-rect.ts Normal file
View File

@@ -0,0 +1,7 @@
import type { RgbaColor, ScreenRect, WebGlRendererContext } from "./types";
export function clearScreenRect(context: WebGlRendererContext, rect: ScreenRect, color: RgbaColor) {
context.gl.scissor(rect.x, context.canvas.height - rect.y - rect.h, rect.w, rect.h);
context.gl.clearColor(...color);
context.gl.clear(context.gl.COLOR_BUFFER_BIT);
}