diff options
author | Melissa Zhang <mzhang19096@gmail.com> | 2020-04-26 12:18:10 -0700 |
---|---|---|
committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-04-26 12:18:10 -0700 |
commit | fbd1f11cbd1aef4ea5fefa868662a66ab41ba62b (patch) | |
tree | a0c8bc84d87e18784339238e961e9d5203338f4c /src/client/views/nodes/ComparisonBox.tsx | |
parent | 88f14beadcf633c303d2fba97516c3b4efe6b4ee (diff) |
set new icon
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; |