Skip to content

Commit b4f8094

Browse files
committed
Whoops.
1 parent cd0934b commit b4f8094

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/canvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class CanvasConstructor {
207207
const { style = '', size, font } = this.font;
208208
if (isNaN(size)) throw new TypeError('The parameter size must be a valid number.');
209209
const { width } = this.measureText(text);
210-
const newLength = maxWidth > width ? maxWidth : (maxWidth / width) * size;
210+
const newLength = maxWidth > width ? size : (maxWidth / width) * size;
211211
return this
212212
.setTextFont(`${style}${newLength}px ${font}`)
213213
.addText(text, x, y);

0 commit comments

Comments
 (0)