diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/EquationBox.tsx | 7 | ||||
-rw-r--r-- | src/client/views/nodes/FunctionPlotBox.tsx | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/client/views/nodes/EquationBox.tsx b/src/client/views/nodes/EquationBox.tsx index f49405d02..a8c5430a9 100644 --- a/src/client/views/nodes/EquationBox.tsx +++ b/src/client/views/nodes/EquationBox.tsx @@ -32,6 +32,12 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps, EquationDo this._ref.current!.mathField.focus(); this._ref.current!.mathField.select(); } + reaction(() => StrCast(this.dataDoc.text), + text => { + if (text && text !== this._ref.current!.mathField.latex()) { + this._ref.current!.mathField.latex(text); + } + }) reaction(() => this.props.isSelected(), selected => { if (this._ref.current) { @@ -78,6 +84,7 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps, EquationDo } render() { TraceMobx(); + console.log("eqn" + this.dataDoc.text) return (<div onPointerDown={e => !e.ctrlKey && e.stopPropagation()} style={{ pointerEvents: !this.props.isSelected() ? "none" : undefined, diff --git a/src/client/views/nodes/FunctionPlotBox.tsx b/src/client/views/nodes/FunctionPlotBox.tsx index f35677014..9094651f3 100644 --- a/src/client/views/nodes/FunctionPlotBox.tsx +++ b/src/client/views/nodes/FunctionPlotBox.tsx @@ -33,7 +33,7 @@ export class FunctionPlotBox extends ViewBoxBaseComponent<FieldViewProps, Equati } componentDidMount() { this.props.setContentView?.(this); - reaction(() => [DocListCast(this.dataDoc.data).lastElement()?.text, this.dataDoc.xRange, this.dataDoc.yRange], + reaction(() => [DocListCast(this.dataDoc.data).lastElement()?.text, this.layoutDoc.width, this.layoutDoc.height, this.dataDoc.xRange, this.dataDoc.yRange], () => this.createGraph()); } getAnchor = () => { |