zoom issue.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user