Skip to content

Commit

Permalink
Minor improvement to reduce function call
Browse files Browse the repository at this point in the history
  • Loading branch information
jiakuan committed Feb 3, 2023
1 parent a4af5c3 commit ce0d244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/canvas-txt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const canvasTxt = {
while (textpixlen < linelen) {
textlen++
texttoprint = temptext.substr(0, textlen)
textpixlen = ctx.measureText(temptext.substr(0, textlen)).width
textpixlen = ctx.measureText(texttoprint).width
}
// Remove last character that was out of the box
textlen--
Expand Down

0 comments on commit ce0d244

Please sign in to comment.