aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-04-23 01:16:41 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-04-23 01:16:41 -0400
commitd3ef96c725761ec172271c314fbe95a962a2b396 (patch)
treeaf6e98974e4dbd4bab67a225cd00709f3a02e032 /src/client/views/collections/collectionFreeForm
parent68add612a037349541b65bc1d1a671199dbfa50b (diff)
parent448a62581fbbad3af8073a195ca45aba2270d239 (diff)
Merge branch 'master' into leftbuttondominant
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx1
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeView.tsx24
2 files changed, 11 insertions, 14 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 879bf5bb5..117343ef3 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -297,7 +297,6 @@ export class CollectionFreeFormView extends CollectionSubView {
getContainerTransform={this.getContainerTransform} getTransform={this.getTransform}>
<CollectionFreeFormViewPannableContents centeringShiftX={this.centeringShiftX} centeringShiftY={this.centeringShiftY}
zoomScaling={this.zoomScaling} panX={this.panX} panY={this.panY}>
-
<CollectionFreeFormLinksView {...this.props} key="freeformLinks">
<InkingCanvas getScreenTransform={this.getTransform} Document={this.props.Document} >
{this.childViews}
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index a1dcb4194..a624c671f 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -69,8 +69,8 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
}
@action
onPointerDown = (e: React.PointerEvent): void => {
- if ((CollectionFreeFormView.RIGHT_BTN_DRAG && (e.buttons === 1 && !e.altKey && !e.metaKey && this.props.container.props.active())) ||
- (!CollectionFreeFormView.RIGHT_BTN_DRAG && (!e.metaKey && (e.altKey || this.props.container.props.active())))) {
+ if ((e.button === 0 && !e.altKey && !e.metaKey && this.props.container.props.active()) ||
+ (!CollectionFreeFormView.RIGHT_BTN_DRAG && (e.button === 2 || (e.button === 0 && e.altKey)) && this.props.container.props.active())) {
this._downX = this._lastX = e.pageX;
this._downY = this._lastY = e.pageY;
this._used = false;
@@ -79,8 +79,6 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
document.addEventListener("pointermove", this.onPointerMove, true);
document.addEventListener("pointerup", this.onPointerUp, true);
document.addEventListener("keydown", this.marqueeCommand, true);
- if (e.button == 2 || e.altKey)
- e.stopPropagation();
}
if (e.altKey)
e.preventDefault();
@@ -95,13 +93,13 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
this._showOnUp = false;
PreviewCursor.Visible = false;
}
- if ((CollectionFreeFormView.RIGHT_BTN_DRAG && (!this._used && e.buttons === 1 && !e.altKey && !e.metaKey)) ||
- (!CollectionFreeFormView.RIGHT_BTN_DRAG && (!this._used && (e.buttons === 2 || e.altKey) && !e.metaKey))) {
- if ((Math.abs(this._lastX - this._downX) > MarqueeView.DRAG_THRESHOLD || Math.abs(this._lastY - this._downY) > MarqueeView.DRAG_THRESHOLD)) {
- this._visible = true;
- e.stopPropagation();
- e.preventDefault();
- }
+ if (!this._used &&
+ (!CollectionFreeFormView.RIGHT_BTN_DRAG && (e.buttons === 2 || (e.buttons == 1 && e.altKey))) ||
+ (CollectionFreeFormView.RIGHT_BTN_DRAG && e.buttons === 1 && !e.altKey && !e.metaKey) &&
+ (Math.abs(this._lastX - this._downX) > MarqueeView.DRAG_THRESHOLD || Math.abs(this._lastY - this._downY) > MarqueeView.DRAG_THRESHOLD)) {
+ this._visible = true;
+ e.stopPropagation();
+ e.preventDefault();
}
}
if (e.altKey)
@@ -115,8 +113,8 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
if (this._showOnUp) {
PreviewCursor.Show(this.hideCursor, this._downX, this._downY);
document.addEventListener("keypress", this.onKeyPress, false);
- } else if (CollectionFreeFormView.RIGHT_BTN_DRAG ||
- (!CollectionFreeFormView.RIGHT_BTN_DRAG && (e.button === 2 || e.altKey))) {
+ } else if ((CollectionFreeFormView.RIGHT_BTN_DRAG && e.button === 0 && !e.altKey && !e.metaKey) ||
+ (!CollectionFreeFormView.RIGHT_BTN_DRAG && ((e.button === 0 && e.altKey) || e.button === 2))) {
let mselect = this.marqueeSelect();
if (!e.shiftKey) {
SelectionManager.DeselectAll(mselect.length ? undefined : this.props.container.props.Document);