zoom issue.

This commit is contained in:
David Allemang
2026-07-06 14:15:04 -04:00
parent 0a32b46e93
commit a6cedbc429
2 changed files with 9 additions and 5 deletions

View File

@@ -381,9 +381,13 @@ export class Engine {
this.canvas.height = Math.max(this.canvas.height, targetH);
}
gl.viewport(0, 0, targetW, targetH);
const viewportY = this.canvas.height - targetH;
gl.viewport(0, viewportY, targetW, targetH);
gl.enable(gl.SCISSOR_TEST);
gl.scissor(0, viewportY, targetW, targetH);
gl.clearColor(0.0, 0.0, 0.0, 0.0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.disable(gl.SCISSOR_TEST);
const aspect = rect.width / rect.height;
const viewProj = diorama.updateMatrices(aspect);