Skip to content

Commit

Permalink
fix remeasure font. #24
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed May 14, 2024
1 parent f7ee513 commit f3c128d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ const Editor: React.FC<{setRestart?, onDidChangeContent?, value: string, theme:
const [dragging, setDragging] = useState<boolean | null>(false)
const [restartMessage, setRestartMessage] = useState<boolean | null>(false)

useEffect(() => {
console.log('Font is ready, rescaling editor.')
document.fonts.ready.then(function () {
monaco.editor.remeasureFonts()
})
}, [editor])

useEffect(() => {
if (['lightPlus', 'custom'].includes(theme)) {
monaco.editor.setTheme(theme)
Expand Down

0 comments on commit f3c128d

Please sign in to comment.