Skip to content
Snippets Groups Projects
Commit 396d5a74 authored by Eugen Ciur's avatar Eugen Ciur
Browse files

fix clicking bug

parent 952104e4
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,16 @@ class UISelect {
Desktop like select
**/
get DRAG_THRESHOLD() {
/*
Some mouse clicks are acompanied by slight mouse movements, which
makes 'clicks' look like mouse drag events. In order the avoid
this confusion, DRAG_THRESHOLD is introduced. Any rectangle with
height or width < DRAG_THRESHOLD will be discarded.
*/
return 5;
}
constructor(parent_selector) {
/***
x, y coordinates where selection started.
......@@ -77,6 +87,11 @@ class UISelect {
new Rectangle(left, top, width, height)
);
if (width < this.DRAG_THRESHOLD && height < this.DRAG_THRESHOLD) {
console.log('Not passing DRAG_THRESHOLD. Ignored.');
return;
}
this.select_nodes(selected_nodes);
this.unselect_nodes(unselected_nodes);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment