refactor(renderer): extract artboard checkerboard drawing
This commit is contained in:
7
renderer/clear-rect.ts
Normal file
7
renderer/clear-rect.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user