diff options
Diffstat (limited to 'src/client/views/nodes/ComparisonBox.tsx')
-rw-r--r-- | src/client/views/nodes/ComparisonBox.tsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx index 6ca0397e2..09590aff7 100644 --- a/src/client/views/nodes/ComparisonBox.tsx +++ b/src/client/views/nodes/ComparisonBox.tsx @@ -60,8 +60,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps, C window.addEventListener("pointerup", this.onPointerUp); } - private resizeUpdater: Lambda = () => { }; - + private resizeUpdater: Lambda | undefined; componentWillMount() { this.props.Document.clipWidth = this.props.PanelWidth() / 2; @@ -72,11 +71,10 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps, C } componentWillUnmount() { - this.resizeUpdater(); + if (this.resizeUpdater) this.resizeUpdater(); } private onPointerMove = ({ movementX }: PointerEvent) => { - //is it ok to use NumCast const width = movementX * this.props.ScreenToLocalTransform().Scale + NumCast(this.props.Document.clipWidth); if (width && width > 5 && width < this.props.PanelWidth()) { this.props.Document.clipWidth = width; |