We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd0934b commit b4f8094Copy full SHA for b4f8094
src/canvas.js
@@ -207,7 +207,7 @@ class CanvasConstructor {
207
const { style = '', size, font } = this.font;
208
if (isNaN(size)) throw new TypeError('The parameter size must be a valid number.');
209
const { width } = this.measureText(text);
210
- const newLength = maxWidth > width ? maxWidth : (maxWidth / width) * size;
+ const newLength = maxWidth > width ? size : (maxWidth / width) * size;
211
return this
212
.setTextFont(`${style}${newLength}px ${font}`)
213
.addText(text, x, y);
0 commit comments