Replace % 2 with & 1 (modulo 2).

This commit is contained in:
Jürg Lehni 2011-03-03 12:46:31 +00:00
parent 231343c6a2
commit b29a87653d

View file

@ -172,7 +172,7 @@ Raster = Item.extend({
// Start with the first coordinate pair for both (coords.slice(0, 2)).
var min = coords.slice(0, 2), max = min.slice(0);
for (var i = 2; i < 8; i++) {
var c = coords[i], j = i % 2;
var c = coords[i], j = i & 1; // i & 1 == i % 2 == i modulo 2
if (c < min[j])
min[j] = c;
else if (c > max[j])