Skip to content

Commit

Permalink
fixed stack overflow when gridGap is at zero (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtReMLapin authored Apr 20, 2023
1 parent 3b9f6f2 commit 787abd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ function clamp(num, a, b) {
}

function getDensity(data) {
if (gridGap === 0)
{
return 1;
}
const fontSize = 11;
ctx.font = `${fontSize * data.pixelRatio}px Arial`;
const rulerWidth = ctx.measureText('99:99:99').width;
Expand Down

0 comments on commit 787abd8

Please sign in to comment.