aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionBaseView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-04-23 15:24:10 -0400
committerbob <bcz@cs.brown.edu>2019-04-23 15:24:10 -0400
commit1eaf7210492e3cc968f26d848c6db7b4e603a657 (patch)
treef56128da5e731897460ee3579186de8db168bbbd /src/client/views/collections/CollectionBaseView.tsx
parent49131cc84b0f3e739edb5ffcd64f3acc9469f658 (diff)
maybe working events?
Diffstat (limited to 'src/client/views/collections/CollectionBaseView.tsx')
-rw-r--r--src/client/views/collections/CollectionBaseView.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionBaseView.tsx b/src/client/views/collections/CollectionBaseView.tsx
index 962cb9b65..097236c1d 100644
--- a/src/client/views/collections/CollectionBaseView.tsx
+++ b/src/client/views/collections/CollectionBaseView.tsx
@@ -103,8 +103,11 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> {
this.props.Document.Set(this.props.fieldKey, new ListField([doc]));
}
// set the ZoomBasis only if hasn't already been set -- bcz: maybe set/resetting the ZoomBasis should be a parameter to addDocument?
- doc.GetTAsync(KeyStore.ZoomBasis, NumberField, field => !field &&
- doc.SetNumber(KeyStore.ZoomBasis, this.props.Document.GetNumber(KeyStore.Scale, 1)));
+ if (this.collectionViewType === CollectionViewType.Freeform || this.collectionViewType === CollectionViewType.Invalid) {
+ let zoom = this.props.Document.GetNumber(KeyStore.Scale, 1);
+ let screen = this.props.ScreenToLocalTransform().inverse().Scale / (this.props as any).ContentScaling() * zoom;
+ doc.SetNumber(KeyStore.ZoomBasis, screen);
+ }
}
return true;
// bcz: What is this code trying to do?