report-studio 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,13 @@ import {
26
26
  } from './rulers.js';
27
27
 
28
28
 
29
+ /**
30
+ * How far, in screen pixels, the pointer goes before a press on an item is a
31
+ * drag rather than a click. The rail's label scrubbing waits for the same.
32
+ */
33
+ export const DRAG_START = 3;
34
+
35
+
29
36
  /**
30
37
  * Wires selection, dragging and resizing onto a designer canvas.
31
38
  *
@@ -380,7 +387,20 @@ export function attachEditing({
380
387
 
381
388
  setMeasuring(event.altKey);
382
389
 
383
- if (!drag.moved && Math.abs(dx) < 1 && Math.abs(dy) < 1) return;
390
+ /**
391
+ * A press only becomes a drag once the pointer has really gone
392
+ * somewhere - measured on the screen, not the page, so it is the same
393
+ * flick of the wrist at every zoom.
394
+ *
395
+ * It used to be one page pixel, which a hand resting on a mouse moves
396
+ * during an ordinary click. That click then counted as a drag: the
397
+ * item went to the nearest 10px grid line and to any edge within
398
+ * SNAP of it - a box at y 44 clicked to select it landed on 40 - and
399
+ * the move was saved as an undo step nobody had made.
400
+ */
401
+ if (!drag.moved
402
+ && Math.abs(event.clientX - drag.startX) < DRAG_START
403
+ && Math.abs(event.clientY - drag.startY) < DRAG_START) return;
384
404
  drag.moved = true;
385
405
 
386
406
  if (drag.mode === 'resize') {