Skip to content

Commit

Permalink
Render area control via glScissor
Browse files Browse the repository at this point in the history
  • Loading branch information
erikhaandrikman committed Nov 26, 2024
1 parent 1015aa5 commit cd8e4e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/renderers/webgl/WebGlCoreRenderOp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class WebGlCoreRenderOp extends CoreRenderOp {
// Clipping
if (this.clippingRect.valid) {
const { x, y, width, height } = this.clippingRect;
const pixelRatio = options.pixelRatio;
const pixelRatio = this.parentHasRenderTexture ? 1 : options.pixelRatio;
const canvasHeight = options.canvas.height;

const clipX = Math.round(x * pixelRatio);
Expand All @@ -109,8 +109,8 @@ export class WebGlCoreRenderOp extends CoreRenderOp {
: 0;
}

glw.viewport(clipX, clipY, clipWidth, clipHeight);
glw.setScissorTest(true);
glw.scissor(clipX, clipY, clipWidth, clipHeight);
} else {
glw.setScissorTest(false);
}
Expand Down

0 comments on commit cd8e4e9

Please sign in to comment.