mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Replace % 2 with & 1 (modulo 2).
This commit is contained in:
parent
231343c6a2
commit
b29a87653d
1 changed files with 1 additions and 1 deletions
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue