Fix note text fitting for multiline support

This commit is contained in:
Mitchell McCaffrey 2021-01-14 15:14:07 +11:00
parent d0654df19d
commit e91cdfcac2

View File

@ -108,7 +108,8 @@ function Note({
const size = sizes.reduce((prev, curr) => { const size = sizes.reduce((prev, curr) => {
text.fontSize(curr); text.fontSize(curr);
const width = text.getTextWidth() + notePadding * 2; const width = text.getTextWidth() + notePadding * 2;
if (width < noteWidth) { const height = text.height() + notePadding * 2;
if (width < noteWidth && height < noteHeight) {
return curr; return curr;
} else { } else {
return prev; return prev;