From 4f91e55365e3139e2d81d74df82b8a75246ae03e Mon Sep 17 00:00:00 2001 From: Chad Walker <chad@chad-cat-lore-eddie.com> Date: Tue, 16 Sep 2014 00:51:19 -0500 Subject: [PATCH] fix pen stroke coloring - use >>> to coerce negative numbers into 32-bit ints --- js/Stage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/Stage.js b/js/Stage.js index e433955..6f5e8f8 100644 --- a/js/Stage.js +++ b/js/Stage.js @@ -66,6 +66,6 @@ Stage.prototype.stroke = function(from, to, width, color) { // Use .5 offsets for canvas rigid pixel drawing this.lineCache.moveTo(from[0] + 240.5, 180.5 - from[1]); this.lineCache.lineTo(to[0] + 240.5, 180.5 - to[1]); - this.lineCache.strokeStyle = 'rgb(' + (color >> 16) + ',' + (color >> 8 & 255) + ',' + (color & 255) + ')'; + this.lineCache.strokeStyle = 'rgb(' + (color >>> 16 & 255) + ',' + (color >>> 8 & 255) + ',' + (color >>> 0 & 255) + ')'; this.lineCache.stroke(); };