aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-10-05 10:37:00 -0400
committerbobzel <zzzman@gmail.com>2022-10-05 10:37:00 -0400
commit1a0e7817754c9fbed5be0820872e9eff3c96d9bb (patch)
tree8ebc1163427e2a72f04b78b5fb1dfd4ab28391d2
parentf1311ad50b925dd9f9731774f273c722c06f5cf5 (diff)
Update CollectionFreeFormView.tsx
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 93bf143df..adf573061 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -157,8 +157,8 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
@computed get cachedCenteringShiftY(): number {
const scaling = this.fitContentsToBox || !this.nativeDimScaling ? 1 : this.nativeDimScaling;
// if freeform has a native aspect, then the panel height needs to be adjusted to match it
- const aspect = this.props.DocumentView?.().nativeHeight ? this.props.DocumentView?.().nativeHeight / this.props.DocumentView?.().nativeWidth : 1;
- return this.props.isAnnotationOverlay ? 0 : (aspect * this.props.PanelHeight()) / 2 / scaling; // shift so pan position is at center of window for non-overlay collections
+ const aspect = (this.props.DocumentView?.().nativeHeight || this.props.PanelHeight()) / (this.props.DocumentView?.().nativeWidth || this.props.PanelWidth());
+ return this.props.isAnnotationOverlay ? 0 : (aspect * this.props.PanelWidth()) / 2 / scaling; // shift so pan position is at center of window for non-overlay collections
}
@computed get cachedGetLocalTransform(): Transform {
return Transform.Identity()