Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
miseler authored May 5, 2024
1 parent f1abd8c commit d3e6d33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/infoclk/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// Determine the font size needed to fit a string of the given length widthin maxWidth number of pixels, clamped between minSize and maxSize
let getFontSize = function (length, maxWidth, minSize, maxSize) {
let size = Math.floor(maxWidth / length); //Number of pixels of width available to character
size *= (16 / 12); //Convert to height, assuming 20 pixels of height for every 12 of width
size *= (12 / 12); //Convert to height, assuming 20 pixels of height for every 12 of width

// Clamp to within range
if (size < minSize) return minSize;
Expand Down

0 comments on commit d3e6d33

Please sign in to comment.