aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-02-16 21:28:28 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-02-16 21:28:28 -0500
commitf0cff850172c888f6b5b661176fcd921c11cd6a9 (patch)
tree6076be66b9f6a345d6044b71eb975b7823f3a96b /src/client/views/collections/CollectionFreeFormView.tsx
parent7be7414daf07be174ee6febd52e6dcf9088928f4 (diff)
parent3f98d6ec6050e7faa15179871f0d9669c1188a78 (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into transforms
Diffstat (limited to 'src/client/views/collections/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/CollectionFreeFormView.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx
index c2b4d80c6..b5e954e83 100644
--- a/src/client/views/collections/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/CollectionFreeFormView.tsx
@@ -138,8 +138,8 @@ export class CollectionFreeFormView extends CollectionViewBase {
@action
private SetPan(panX: number, panY: number) {
- const newPanX = Math.max(-(this.resizeScaling * this.zoomScaling - this.resizeScaling) * this.nativeWidth, Math.min(0, panX));
- const newPanY = Math.max(-(this.resizeScaling * this.zoomScaling - this.resizeScaling) * this.nativeHeight, Math.min(0, panY));
+ const newPanX = Math.max((1 - this.zoomScaling) * this.nativeWidth, Math.min(0, panX));
+ const newPanY = Math.max((1 - this.zoomScaling) * this.nativeHeight, Math.min(0, panY));
this.props.DocumentForCollection.SetNumber(KeyStore.PanX, this.isAnnotationOverlay ? newPanX : panX);
this.props.DocumentForCollection.SetNumber(KeyStore.PanY, this.isAnnotationOverlay ? newPanY : panY);
}
@@ -151,8 +151,8 @@ export class CollectionFreeFormView extends CollectionViewBase {
let fReader = new FileReader()
let file = e.dataTransfer.items[0].getAsFile();
let that = this;
- const panx: number = this.props.DocumentForCollection.GetData(KeyStore.PanX, NumberField, Number(0));
- const pany: number = this.props.DocumentForCollection.GetData(KeyStore.PanY, NumberField, Number(0));
+ const panx: number = this.props.DocumentForCollection.GetNumber(KeyStore.PanX, 0);
+ const pany: number = this.props.DocumentForCollection.GetNumber(KeyStore.PanY, 0);
let x = e.pageX - panx
let y = e.pageY - pany