diff --git a/src/renderer/webgl/Utils.js b/src/renderer/webgl/Utils.js index 0c82875d3..b97a684b8 100644 --- a/src/renderer/webgl/Utils.js +++ b/src/renderer/webgl/Utils.js @@ -7,7 +7,7 @@ module.exports = { var ub = ((b * 255.0)|0) & 0xFF; var ua = ((a * 255.0)|0) & 0xFF; - return (ua << 24) | (ub << 16) | (ug << 8) | ur; + return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; }, getTintAppendFloatAlpha: function (rgb, a) @@ -17,7 +17,7 @@ module.exports = { var ub = (rgb|0) & 0xff; var ua = ((a * 255.0)|0) & 0xFF; - return (ua << 24) | (ub << 16) | (ug << 8) | ur; + return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; } }; \ No newline at end of file diff --git a/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js b/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js index 369604248..bdaf592ca 100644 --- a/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js +++ b/src/renderer/webgl/pipelines/blitterbatch/BlitterBatch.js @@ -117,10 +117,10 @@ var BlitterBatch = new Class({ var uvs = frame.uvs; var flipX = bob.flipX; var flipY = bob.flipY; - var x = bob.x + frame.x - cameraScrollX + (width * (flipX ? 1.0 : 0.0)); - var y = bob.y + frame.y - cameraScrollY + (height * (flipY ? 1.0 : 0.0)); var width = frame.width * (flipX ? -1.0 : 1.0); var height = frame.height * (flipY ? -1.0 : 1.0); + var x = bob.x + frame.x - cameraScrollX + (width * ((flipX) ? 1.0 : 0.0)); + var y = bob.y + frame.y - cameraScrollY + (height * ((flipY) ? 1.0 : 0.0)); var xw = x + width; var yh = y + height; var tx = x * a + y * c + e;