Discount right-clicks during double up detection

This commit is contained in:
Quincy Morgan
2020-03-26 13:27:15 -07:00
parent 4a67e8c5dc
commit 4addcc961d
+9 -1
View File
@@ -1,5 +1,5 @@
import { dispatch as d3_dispatch } from 'd3-dispatch';
import { mouse as d3_mouse } from 'd3-selection';
import { event as d3_event, mouse as d3_mouse } from 'd3-selection';
import { utilRebind } from './rebind';
import { geoVecLength } from '../geo/vector';
@@ -22,6 +22,10 @@ export function utilDoubleUp() {
}
function pointerdown() {
// ignore right-click
if (d3_event.ctrlKey || d3_event.button === 2) return;
// d3_mouse works since pointer events inherit from mouse events
var loc = d3_mouse(this);
@@ -40,6 +44,10 @@ export function utilDoubleUp() {
}
function pointerup() {
// ignore right-click
if (d3_event.ctrlKey || d3_event.button === 2) return;
if (!_pointer) return;
_pointer.upCount += 1;