Skip to content

Commit a8320b9

Browse files
committed
remove magic numbers
1 parent 9f15b86 commit a8320b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/RenderWebGL.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,12 @@ class RenderWebGL extends EventEmitter {
14541454
twgl.bindFramebufferInfo(gl, skin._framebuffer);
14551455

14561456
// Limit size of viewport to the bounds around the stamp Drawable and create the projection matrix for the draw.
1457-
gl.viewport(240 + bounds.left, 180 - bounds.top, bounds.width, bounds.height);
1457+
gl.viewport(
1458+
(this._nativeSize[0] * 0.5) + bounds.left,
1459+
(this._nativeSize[1] * 0.5) - bounds.top,
1460+
bounds.width,
1461+
bounds.height
1462+
);
14581463
const projection = twgl.m4.ortho(bounds.left, bounds.right, bounds.top, bounds.bottom, -1, 1);
14591464

14601465
// Draw the stamped sprite onto the PenSkin's framebuffer.

0 commit comments

Comments
 (0)