Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce 100ms timeout in MainProcessMouseMove
Browse files Browse the repository at this point in the history
alja committed Apr 17, 2019
1 parent 1a673f1 commit bc2a6e8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions js/scripts/JSRoot3DPainter.js
Original file line number Diff line number Diff line change
@@ -503,6 +503,27 @@
}

control.MainProcessMouseMove = function(evnt) {
// check timeout
var toutval = 100;

// first time
var dt = new Date();
if (!this.mouse_tmout) {
this.mouse_tmout = setTimeout(this.MainProcessMouseMove.bind(this,evnt), toutval);
this.tt = dt.getTime();
return;
}
else {
var tdiff = dt.getTime() - this.tt;
if (tdiff < toutval) {
clearTimeout(this.mouse_tmout);
this.mouse_tmout = setTimeout(this.MainProcessMouseMove.bind(this,evnt), tdiff);
return;
}
}
this.tt = dt.getTime();
//console.log("control.MainProcessMouseMove");

if (this.control_active && evnt.buttons && (evnt.buttons & 2))
this.block_ctxt = true; // if right button in control was active, block next context menu

0 comments on commit bc2a6e8

Please sign in to comment.