Skip to content
This repository

Wax interaction works after drag #15

Merged
merged 1 commit into from about 2 years ago

2 participants

Ansis Brammanis Matt Greene
Ansis Brammanis
Collaborator
ansis commented

The biggest change is that interaction using wax should now work even after dragging, fixing this issue: #12

It also fixes the case where you drag out of bounds and release the mouse. Before mouseUp wouldn't get triggered, leaving it "stuck".

Matt Greene MateoV merged commit 70615c4 into from
Matt Greene MateoV closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 18, 2012
Ansis Brammanis ansis utfgrid interaction works after drag 7e98121
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. +4 2 src/easey.handlers.js
6 src/easey.handlers.js
@@ -372,6 +372,8 @@
372 372
373 373 function mouseDown(e) {
374 374 if (e.shiftKey || e.button == 2) return;
  375 + MM.addEvent(document, 'mousemove', mouseMove);
  376 + MM.addEvent(document, 'mouseup', mouseUp);
375 377 mousePoint = prevMousePoint = MM.getMousePoint(e, map);
376 378 moveTime = prevMoveTime = +new Date();
377 379 map.parent.style.cursor = 'move';
@@ -392,6 +394,8 @@
392 394 }
393 395
394 396 function mouseUp(e) {
  397 + MM.removeEvent(document, 'mousemove', mouseMove);
  398 + MM.removeEvent(document, 'mouseup', mouseUp);
395 399 if (+new Date() - prevMoveTime < 50) {
396 400 dt = Math.max(1, moveTime - prevMoveTime);
397 401 var dir = { x: 0, y: 0 };
@@ -442,8 +446,6 @@
442 446 map.parent.focus();
443 447 });
444 448 MM.addEvent(map.parent, 'mousedown', mouseDown);
445   - MM.addEvent(map.parent, 'mousemove', mouseMove);
446   - MM.addEvent(map.parent, 'mouseup', mouseUp);
447 449 prevT = new Date().getTime();
448 450 speed = { x: 0, y: 0 };
449 451 MM.getFrame(animate);

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.