Fix note and token text size on visible change

This commit is contained in:
Mitchell McCaffrey 2021-04-11 13:49:29 +10:00
parent b9ce0fd03d
commit 6216d3f813
2 changed files with 10 additions and 2 deletions

View File

@ -150,7 +150,7 @@ function Note({
}
findFontSize();
}, [note, note.text, noteWidth, noteHeight, notePadding]);
}, [note, note.text, note.visible, noteWidth, noteHeight, notePadding]);
const textRef = useRef();

View File

@ -45,7 +45,15 @@ function TokenLabel({ tokenState, width, height }) {
}
findFontSize();
}, [tokenState.label, width, height, tokenState, labelSize, paddingX]);
}, [
tokenState.label,
tokenState.visible,
width,
height,
tokenState,
labelSize,
paddingX,
]);
const [rectWidth, setRectWidth] = useState(0);
useEffect(() => {