Changed notes to left aligned and accept more text per line
This commit is contained in:
parent
ed605fe55b
commit
93f45c738f
@ -11,6 +11,8 @@ import colors from "../../helpers/colors";
|
||||
import usePrevious from "../../hooks/usePrevious";
|
||||
import useGridSnapping from "../../hooks/useGridSnapping";
|
||||
|
||||
const minTextSize = 16;
|
||||
|
||||
function Note({
|
||||
note,
|
||||
map,
|
||||
@ -117,10 +119,10 @@ function Note({
|
||||
}
|
||||
|
||||
function findFontSize() {
|
||||
// Create an array from 1 / 10 of the note height to the full note height
|
||||
// Create an array from 1 / minTextSize of the note height to the full note height
|
||||
const sizes = Array.from(
|
||||
{ length: Math.ceil(noteHeight - notePadding * 2) },
|
||||
(_, i) => i + Math.ceil(noteHeight / 10)
|
||||
(_, i) => i + Math.ceil(noteHeight / minTextSize)
|
||||
);
|
||||
|
||||
if (sizes.length > 0) {
|
||||
@ -203,7 +205,7 @@ function Note({
|
||||
? "white"
|
||||
: "black"
|
||||
}
|
||||
align="center"
|
||||
align="left"
|
||||
verticalAlign="middle"
|
||||
padding={notePadding}
|
||||
fontSize={fontSize}
|
||||
|
@ -53,7 +53,7 @@ function NoteMenu({
|
||||
}, [isOpen, note, wasOpen, noteNode]);
|
||||
|
||||
function handleTextChange(event) {
|
||||
const text = event.target.value.substring(0, 144);
|
||||
const text = event.target.value.substring(0, 1024);
|
||||
note && onNoteChange({ ...note, text: text });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user