aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index a32db767f..2c76a80a1 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1021,7 +1021,8 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
onPointerWheel = (e: React.WheelEvent): void => {
if (this.layoutDoc._Transform || DocListCast(Doc.MyOverlayDocs?.data).includes(this.props.Document) || this.props.Document.treeViewOutlineMode === TreeViewType.outline) return;
e.stopPropagation();
- switch (Doc.UserDoc().freeformScrollMode) {
+ e.preventDefault();
+ switch (!e.ctrlKey ? freeformScrollMode.Pan : Doc.UserDoc().freeformScrollMode) {
case freeformScrollMode.Pan:
// if shift is selected then zoom
if (e.ctrlKey) {
@@ -1034,8 +1035,8 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
} else if (!e.ctrlKey && this.props.Document.scrollHeight !== undefined) {
// things that can scroll vertically should do that instead of zooming
} else if (this.props.isContentActive(true) && !this.Document._isGroup) {
- const dx = e.deltaX;
- const dy = e.deltaY;
+ const dx = -e.deltaX;
+ const dy = -e.deltaY;
if (e.shiftKey) {
!this.props.isAnnotationOverlayScrollable && this.scrollPan({ deltaX: dy, deltaY: 0 });
} else {
@@ -1185,7 +1186,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
const focusSpeed = options?.instant ? 0 : didMove ? options.zoomTime ?? 500 : 0;
// glr: freeform transform speed can be set by adjusting presTransition field - needs a way of knowing when presentation is not active...
if (didMove) {
- scale && (this.Document[this.scaleFieldKey] = scale);
+ options.zoomScale && scale && (this.Document[this.scaleFieldKey] = scale);
this.setPan(panX, panY, focusSpeed, true); // docs that are floating in their collection can't be panned to from their collection -- need to propagate the pan to a parent freeform somehow
}
@@ -1342,6 +1343,8 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
addDocTab = action((doc: Doc, where: OpenWhere) => {
switch (where) {
case OpenWhere.inParent:
+ return this.props.addDocument?.(doc) || false;
+ case OpenWhere.inParentFromScreen:
return (
this.props.addDocument?.(
(doc instanceof Doc ? [doc] : doc).map(doc => {
@@ -1742,7 +1745,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
doc.x = scr?.[0];
doc.y = scr?.[1];
});
- this.props.addDocTab(childDocs as any as Doc, OpenWhere.inParent);
+ this.props.addDocTab(childDocs as any as Doc, OpenWhere.inParentFromScreen);
this.props.ContainingCollectionView?.removeDocument(this.props.Document);
};