Skip to content

Commit

Permalink
placementworker: Fix missing var
Browse files Browse the repository at this point in the history
Leaks to global scope, and some browsers cause exception in strict mode
  • Loading branch information
jonnor committed Aug 4, 2017
1 parent c88dc4d commit 70e48b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/placementworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function toNestCoordinates(polygon, scale){

function rotatePolygon(polygon, degrees){
var rotated = [];
angle = degrees * Math.PI / 180;
var angle = degrees * Math.PI / 180;
for(var i=0; i<polygon.length; i++){
var x = polygon[i].x;
var y = polygon[i].y;
Expand Down Expand Up @@ -69,7 +69,7 @@ function PlacementWorker(binPolygon, paths, ids, rotations, config, nfpCache){
// rotate paths by given rotation
var rotated = [];
for(i=0; i<paths.length; i++){
r = rotatePolygon(paths[i], paths[i].rotation);
var r = rotatePolygon(paths[i], paths[i].rotation);
r.rotation = paths[i].rotation;
r.source = paths[i].source;
r.id = paths[i].id;
Expand Down

0 comments on commit 70e48b5

Please sign in to comment.