aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 421d431b3..dd16ab71b 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -1,4 +1,4 @@
-import { action, computed, observable, trace } from 'mobx';
+import { action, computed, observable } from 'mobx';
import { observer } from 'mobx-react';
import { Doc, Opt } from '../../../fields/Doc';
import { List } from '../../../fields/List';
@@ -20,8 +20,8 @@ export interface CollectionFreeFormDocumentViewWrapperProps extends DocumentView
x: number;
y: number;
z: number;
- width: number;
- height: number;
+ width: number; // -1 means use PanelWidth which should be the same as the Document's width, but avoids the delay of waiting for the width prop to change in PanelWidth function
+ height: number; // -1 means use PanelHeight
zIndex?: number;
rotation?: number;
color?: string;
@@ -72,8 +72,8 @@ export class CollectionFreeFormDocumentViewWrapper extends DocComponent<Collecti
w_Transition = () => this.Transition; // prettier-ignore
w_DataTransition = () => this.DataTransition; // prettier-ignore
- PanelWidth = () => this.Width || this.props.PanelWidth?.(); // prettier-ignore
- PanelHeight = () => this.Height || this.props.PanelHeight?.(); // prettier-ignore
+ PanelWidth = () => this.Width > 0 ? this.Width : this.props.PanelWidth?.(); // prettier-ignore
+ PanelHeight = () => this.Height > 0 ? this.Height : this.props.PanelHeight?.(); // prettier-ignore
@action
componentDidUpdate() {
this.WrapperKeys.forEach(keys => ((this as any)[keys.upper] = (this.props as any)[keys.lower]));