Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
KilledByAPixel committed Jan 16, 2024
1 parent 4070dd3 commit 2d2c56a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/engineDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,8 @@ function drawPoly(points, color=new Color, useWebGL=glEnable, screenSpace)
// draw using canvas
mainContext.fillStyle = color;
mainContext.beginPath();
for (const point of points)
{
const pos = screenSpace ? point : worldToScreen(point);
mainContext.lineTo(pos.x, pos.y);
}
for (const point of screenSpace ? points : points.map(worldToScreen))
mainContext.lineTo(point.x, point.y);
mainContext.fill();
}
}
Expand Down

0 comments on commit 2d2c56a

Please sign in to comment.