aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Main.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/Main.tsx')
-rw-r--r--src/client/views/Main.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 5fd778c7e..c4c4a6bf9 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -39,6 +39,7 @@ import "./Main.scss";
import { DocumentView } from './nodes/DocumentView';
import { FormattedTextBox } from './nodes/FormattedTextBox';
import { REPLCommand } from 'repl';
+import { Key } from '../../fields/Key';
@observer
export class Main extends React.Component {
@@ -208,17 +209,19 @@ export class Main extends React.Component {
_textRect: any;
_textXf: Transform = Transform.Identity();
_textScroll: number = 0;
+ _textFieldKey: Key = KeyStore.Data;
_textColor: string | null = null;
_textTargetDiv: HTMLDivElement | undefined;
_textProxyDiv: React.RefObject<HTMLDivElement>;
@action
- SetTextDoc(textDoc?: Document, div?: HTMLDivElement, tx?: Transform) {
+ SetTextDoc(textDoc?: Document, textFieldKey?: Key, div?: HTMLDivElement, tx?: Transform) {
if (this._textTargetDiv) {
this._textTargetDiv.style.color = this._textColor;
}
this._textDoc = undefined;
this._textDoc = textDoc;
+ this._textFieldKey = textFieldKey!;
this._textXf = tx ? tx : Transform.Identity();
this._textTargetDiv = div;
if (div) {
@@ -277,7 +280,7 @@ export class Main extends React.Component {
s[0] = Math.sqrt((s[0] - t[0]) * (s[0] - t[0]) + (s[1] - t[1]) * (s[1] - t[1]));
return <div className="mainDiv-textInput" style={{ pointerEvents: "none", transform: `translate(${x}px, ${y}px) scale(${1 / s[0]},${1 / s[0]})`, width: "auto", height: "auto" }} >
<div className="mainDiv-textInput" onPointerDown={this.textBoxDown} ref={this._textProxyDiv} onScroll={this.textScroll} style={{ pointerEvents: "none", transform: `scale(${1}, ${1})`, width: `${w * s[0]}px`, height: `${h * s[0]}px` }}>
- <FormattedTextBox fieldKey={KeyStore.Archives} Document={this._textDoc} isSelected={returnTrue} select={emptyFunction} isTopMost={true} selectOnLoad={true} onActiveChanged={emptyFunction} active={returnTrue} ScreenToLocalTransform={() => this._textXf} focus={(doc) => { }} />
+ <FormattedTextBox fieldKey={this._textFieldKey!} isOverlay={true} Document={this._textDoc} isSelected={returnTrue} select={emptyFunction} isTopMost={true} selectOnLoad={true} onActiveChanged={emptyFunction} active={returnTrue} ScreenToLocalTransform={() => this._textXf} focus={(doc) => { }} />
</div>
</ div>;
}