improve text editor scaling

This commit is contained in:
Olivier Gagnon 2021-10-15 16:14:27 -04:00
parent f645d08a50
commit e047653ed7

@ -315,7 +315,10 @@ export function Root(props: IProps): React.ReactElement {
monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts"); monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts");
loadThemes(monaco); loadThemes(monaco);
} }
const h = window.innerHeight; // 370px 71%, 725px 85.1%, 1085px 90%, 1300px 91.7%
// fuck around in desmos until you find a function
const p = 11000 / -window.innerHeight + 100;
console.log(p);
return ( return (
<> <>
<Box display="flex" flexDirection="row" alignItems="center"> <Box display="flex" flexDirection="row" alignItems="center">
@ -337,7 +340,7 @@ export function Root(props: IProps): React.ReactElement {
beforeMount={beforeMount} beforeMount={beforeMount}
onMount={onMount} onMount={onMount}
loading={<Typography>Loading script editor!</Typography>} loading={<Typography>Loading script editor!</Typography>}
height={90 - h / 100 + "%"} height={p + "%"}
defaultLanguage="javascript" defaultLanguage="javascript"
defaultValue={code} defaultValue={code}
onChange={updateCode} onChange={updateCode}