From e047653ed764db28a2d5dfce68e04d845af1cd87 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Fri, 15 Oct 2021 16:14:27 -0400 Subject: [PATCH] improve text editor scaling --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index c79489927..730fa8a44 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -315,7 +315,10 @@ export function Root(props: IProps): React.ReactElement { monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts"); 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 ( <> @@ -337,7 +340,7 @@ export function Root(props: IProps): React.ReactElement { beforeMount={beforeMount} onMount={onMount} loading={Loading script editor!} - height={90 - h / 100 + "%"} + height={p + "%"} defaultLanguage="javascript" defaultValue={code} onChange={updateCode}