diff options
| author | bobzel <zzzman@gmail.com> | 2023-12-13 21:17:50 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-12-13 21:17:50 -0500 |
| commit | 1cf241544f8063e3d71406238a584299b6ced794 (patch) | |
| tree | cb2bf6a71abbe76e8e3ab8d6283c0daab850e0a4 /src/client/views/DocumentDecorations.tsx | |
| parent | 35f4d108643d310e4e9da107a5839bb74cc6706f (diff) | |
cleaned up props/_props handling by inherting from ObservableReactComponent
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 8bcc1cb56..7003485d2 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -34,6 +34,7 @@ import { DocumentView, OpenWhereMod } from './nodes/DocumentView'; import { FormattedTextBox } from './nodes/formattedText/FormattedTextBox'; import { ImageBox } from './nodes/ImageBox'; import * as React from 'react'; +import { ObservableReactComponent } from './ObservableReactComponent'; interface DocumentDecorationsProps { PanelWidth: number; @@ -42,7 +43,7 @@ interface DocumentDecorationsProps { boundsTop: number; } @observer -export class DocumentDecorations extends React.Component<DocumentDecorationsProps> { +export class DocumentDecorations extends ObservableReactComponent<DocumentDecorationsProps> { static Instance: DocumentDecorations; private _resizeHdlId = ''; private _keyinput = React.createRef<HTMLInputElement>(); @@ -66,11 +67,10 @@ export class DocumentDecorations extends React.Component<DocumentDecorationsProp @observable private _showRotCenter = false; // whether to show a draggable green dot that represents the center of rotation @observable private _rotCenter = [0, 0]; // the center of rotation in object coordinates (0,0) = object center (not top left!) - @observable _props: React.PropsWithChildren<DocumentDecorationsProps>; constructor(props: React.PropsWithChildren<DocumentDecorationsProps>) { super(props); - this._props = props; makeObservable(this); + DocumentDecorations.Instance = this; document.addEventListener('pointermove', // show decorations whenever pointer moves outside of selection bounds. action(e => { |
