remove magic numbers

This commit is contained in:
adroitwhiz
2019-08-01 22:28:49 -04:00
parent 9f15b86672
commit a8320b9ebc

View File

@@ -1454,7 +1454,12 @@ class RenderWebGL extends EventEmitter {
twgl.bindFramebufferInfo(gl, skin._framebuffer);
// Limit size of viewport to the bounds around the stamp Drawable and create the projection matrix for the draw.
gl.viewport(240 + bounds.left, 180 - bounds.top, bounds.width, bounds.height);
gl.viewport(
(this._nativeSize[0] * 0.5) + bounds.left,
(this._nativeSize[1] * 0.5) - bounds.top,
bounds.width,
bounds.height
);
const projection = twgl.m4.ortho(bounds.left, bounds.right, bounds.top, bounds.bottom, -1, 1);
// Draw the stamped sprite onto the PenSkin's framebuffer.