File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## v1.6.3
22
33- Fix an issue with repeated zooming to points
4+ - Improve lasso on long press start
45
56## v1.6.2
67
Original file line number Diff line number Diff line change @@ -955,6 +955,8 @@ const createScatterplot = (
955955 if ( ! isInit || ( ! isMouseInCanvas && ! mouseDown ) ) return ;
956956
957957 const currentMousePosition = getRelativeMousePosition ( event ) ;
958+ const mouseMoveDist = dist ( ...currentMousePosition , ...mouseDownPosition ) ;
959+ const mouseMovedMin = mouseMoveDist >= lassoMinDist ;
958960
959961 // Only ray cast if the mouse cursor is inside
960962 if ( isMouseInCanvas && ! lassoActive ) {
@@ -964,16 +966,13 @@ const createScatterplot = (
964966 if ( lassoActive ) {
965967 event . preventDefault ( ) ;
966968 lassoManager . extend ( event , true ) ;
967- } else {
968- const mouseMoveDist = dist ( ...currentMousePosition , ...mouseDownPosition ) ;
969- if ( mouseDown && lassoOnLongPress && mouseMoveDist >= lassoMinDist ) {
970- lassoManager . hideLongPressIndicator ( {
971- time : lassoLongPressRevertEffectTime ,
972- } ) ;
973- }
969+ } else if ( mouseDown && lassoOnLongPress && mouseMovedMin ) {
970+ lassoManager . hideLongPressIndicator ( {
971+ time : lassoLongPressRevertEffectTime ,
972+ } ) ;
974973 }
975974
976- if ( mouseDownTimeout >= 0 ) {
975+ if ( mouseDownTimeout >= 0 && mouseMovedMin ) {
977976 clearTimeout ( mouseDownTimeout ) ;
978977 mouseDownTimeout = - 1 ;
979978 }
You can’t perform that action at this time.
0 commit comments