From 747581ac65f706710becad034c5f5abff76b8e51 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 9 Jun 2020 17:26:05 -0400 Subject: fixed lots of errors/warnings. added 'a' to be able embed documents on drop. added 'l' toggle to perist lasso/marquee mode. --- .../collectionFreeForm/CollectionFreeFormView.tsx | 13 +++++-------- .../views/collections/collectionFreeForm/MarqueeView.scss | 2 +- .../views/collections/collectionFreeForm/MarqueeView.tsx | 9 ++++----- 3 files changed, 10 insertions(+), 14 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index d512f815c..aa4fc48f3 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -177,7 +177,7 @@ export class CollectionFreeFormView extends CollectionSubView { SelectionManager.DeselectAll(); @@ -251,11 +251,11 @@ export class CollectionFreeFormView extends CollectionSubView { // if (this.props.Document.isBackground) return false; const [xp, yp] = this.getTransform().transformPoint(de.x, de.y); - if (this.isAnnotationOverlay !== true && de.complete.linkDragData) + if (this.isAnnotationOverlay !== true && de.complete.linkDragData) { return this.internalLinkDrop(e, de, de.complete.linkDragData, xp, yp); - if (de.complete.annoDragData?.dropDocument && super.onInternalDrop(e, de)) + } else if (de.complete.annoDragData?.dropDocument && super.onInternalDrop(e, de)) { return this.internalPdfAnnoDrop(e, de.complete.annoDragData, xp, yp); - if (de.complete.docDragData?.droppedDocuments.length && this.internalDocDrop(e, de, de.complete.docDragData, xp, yp)) { + } else if (de.complete.docDragData?.droppedDocuments.length && this.internalDocDrop(e, de, de.complete.docDragData, xp, yp)) { return true; } else { UndoManager.Undo(); @@ -530,9 +530,7 @@ export class CollectionFreeFormView extends CollectionSubView { - console.log(results); const wordResults = results.filter((r: any) => r.category === "inkWord"); for (const word of wordResults) { const indices: number[] = word.strokeIds; @@ -617,8 +615,7 @@ export class CollectionFreeFormView extends CollectionSubView this.props.removeDocument(d)); - const newCollection = Doc.pileup(selected, this.Bounds.left + this.Bounds.width / 2, this.Bounds.top + this.Bounds.height / 2); + const newCollection = DocUtils.pileup(selected, this.Bounds.left + this.Bounds.width / 2, this.Bounds.top + this.Bounds.height / 2); this.props.addDocument(newCollection!); this.props.selectDocuments([newCollection!], []); MarqueeOptionsMenu.Instance.fadeOut(true); @@ -527,7 +526,7 @@ export class MarqueeView extends React.Component { - this._freeHand = x; + this._freeHand = !this._freeHand; } // @action // marqueeInkSelect(ink: Map) { @@ -697,7 +696,7 @@ export class MarqueeView extends React.Component - {/* */} + ; } else { -- cgit v1.2.3-70-g09d2 From c3bbedc622080c6087c862d6fb0c8b3438d51edc Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 9 Jun 2020 17:39:35 -0400 Subject: simplified lasso toggle to 'space' when dragging. --- src/client/views/GlobalKeyHandler.ts | 1 + src/client/views/collections/collectionFreeForm/MarqueeView.scss | 2 +- src/client/views/collections/collectionFreeForm/MarqueeView.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm') diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts index 772cb07b1..a3b144055 100644 --- a/src/client/views/GlobalKeyHandler.ts +++ b/src/client/views/GlobalKeyHandler.ts @@ -73,6 +73,7 @@ export default class KeyManager { private unmodified = action((keyname: string, e: KeyboardEvent) => { switch (keyname) { case "a": DragManager.CanEmbed = true; + break; case " ": MarqueeView.DragMarquee = !MarqueeView.DragMarquee; break; diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.scss b/src/client/views/collections/collectionFreeForm/MarqueeView.scss index 45b83c3e3..62510ce9d 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.scss +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.scss @@ -28,6 +28,6 @@ white-space:nowrap; } .marquee-legend::after { - content: "Press 'l' for lasso" + content: "Press for lasso" } } \ No newline at end of file diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx index 7cf526ab8..e793c93df 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx @@ -526,7 +526,7 @@ export class MarqueeView extends React.Component