diff options
author | bobzel <zzzman@gmail.com> | 2024-03-10 09:50:46 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-03-10 09:50:46 -0400 |
commit | 4caca5b32f74beed00bfbdaa181cb69fc001b7ca (patch) | |
tree | 5601b1bdaa8499af44d2ca50dd845ea0a65128b4 /src/client/views/nodes/EquationBox.tsx | |
parent | 3735fd5e8c0f5315d73a28ef59dcff4bc6158c88 (diff) | |
parent | a9eb266296d1b71f1016c867f39e20299c011eea (diff) |
Merge branch 'master' into zach-starter
Diffstat (limited to 'src/client/views/nodes/EquationBox.tsx')
-rw-r--r-- | src/client/views/nodes/EquationBox.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/EquationBox.tsx b/src/client/views/nodes/EquationBox.tsx index 2e03a766a..50d4c7c78 100644 --- a/src/client/views/nodes/EquationBox.tsx +++ b/src/client/views/nodes/EquationBox.tsx @@ -11,6 +11,7 @@ import { LightboxView } from '../LightboxView'; import './EquationBox.scss'; import { FieldView, FieldViewProps } from './FieldView'; import EquationEditor from './formattedText/EquationEditor'; +import { DivHeight, DivWidth } from '../../../Utils'; @observer export class EquationBox extends ViewBoxBaseComponent<FieldViewProps>() { @@ -57,8 +58,8 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps>() { @action keyPressed = (e: KeyboardEvent) => { - const _height = Number(getComputedStyle(this._ref.current!.element.current).height.replace('px', '')); - const _width = Number(getComputedStyle(this._ref.current!.element.current).width.replace('px', '')); + const _height = DivHeight(this._ref.current!.element.current); + const _width = DivWidth(this._ref.current!.element.current); if (e.key === 'Enter') { const nextEq = Docs.Create.EquationDocument(e.shiftKey ? StrCast(this.dataDoc.text) : 'x', { title: '# math', |