From e91cdfcac245f282ed690d7789a62c15c2d4f57c Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 14 Jan 2021 15:14:07 +1100 Subject: [PATCH] Fix note text fitting for multiline support --- src/components/note/Note.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/note/Note.js b/src/components/note/Note.js index 95cf485..c52e202 100644 --- a/src/components/note/Note.js +++ b/src/components/note/Note.js @@ -108,7 +108,8 @@ function Note({ const size = sizes.reduce((prev, curr) => { text.fontSize(curr); const width = text.getTextWidth() + notePadding * 2; - if (width < noteWidth) { + const height = text.height() + notePadding * 2; + if (width < noteWidth && height < noteHeight) { return curr; } else { return prev;