fix: Fixed issue where Super note font size would shift on first load
This commit is contained in:
@@ -136,8 +136,12 @@ export const SuperEditor: FunctionComponent<Props> = ({
|
|||||||
return disposer
|
return disposer
|
||||||
}, [controller, controller.item.uuid])
|
}, [controller, controller.item.uuid])
|
||||||
|
|
||||||
const [lineHeight, setLineHeight] = useState<EditorLineHeight>(PrefDefaults[PrefKey.EditorLineHeight])
|
const [lineHeight, setLineHeight] = useState<EditorLineHeight>(() =>
|
||||||
const [fontSize, setFontSize] = useState<EditorFontSize | undefined>()
|
application.getPreference(PrefKey.EditorLineHeight, PrefDefaults[PrefKey.EditorLineHeight]),
|
||||||
|
)
|
||||||
|
const [fontSize, setFontSize] = useState<EditorFontSize | undefined>(() =>
|
||||||
|
application.getPreference(PrefKey.EditorFontSize, PrefDefaults[PrefKey.EditorFontSize]),
|
||||||
|
)
|
||||||
|
|
||||||
const reloadPreferences = useCallback(() => {
|
const reloadPreferences = useCallback(() => {
|
||||||
const lineHeight = application.getPreference(PrefKey.EditorLineHeight, PrefDefaults[PrefKey.EditorLineHeight])
|
const lineHeight = application.getPreference(PrefKey.EditorLineHeight, PrefDefaults[PrefKey.EditorLineHeight])
|
||||||
|
|||||||
Reference in New Issue
Block a user