mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-25 15:05:32 +00:00
No draw mousemove events while mouse is down
This commit is contained in:
@@ -1,16 +1,25 @@
|
||||
iD.behavior.Draw = function () {
|
||||
var event = d3.dispatch('move', 'add', 'undo', 'cancel', 'finish'),
|
||||
keybinding = d3.keybinding('draw');
|
||||
keybinding = d3.keybinding('draw'),
|
||||
down;
|
||||
|
||||
function draw(selection) {
|
||||
function mousemove() {
|
||||
event.move();
|
||||
if (!down) event.move();
|
||||
}
|
||||
|
||||
function click() {
|
||||
event.add();
|
||||
}
|
||||
|
||||
function mousedown() {
|
||||
down = true;
|
||||
}
|
||||
|
||||
function mouseup() {
|
||||
down = false;
|
||||
}
|
||||
|
||||
function backspace() {
|
||||
d3.event.preventDefault();
|
||||
event.undo();
|
||||
@@ -27,6 +36,8 @@ iD.behavior.Draw = function () {
|
||||
}
|
||||
|
||||
selection
|
||||
.on('mousedown.draw', mousedown)
|
||||
.on('mouseup.draw', mouseup)
|
||||
.on('mousemove.draw', mousemove)
|
||||
.on('click.draw', click);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user