@@ -77,7 +77,7 @@ export abstract class GenericView implements AfterViewInit {
7777 protected canDrag = true ;
7878 protected goodDragStart = false ;
7979 protected debouncedDraw : ( ) => void ;
80- protected debouncedMouseMove : ( ) => void ;
80+ protected throttledMouseMove : ( ) => void ;
8181 protected debouncedResize : ( ) => void ;
8282 protected dragging = false ;
8383 protected excludedPlanets : number [ ] = [ EARTH ] ;
@@ -257,18 +257,18 @@ export abstract class GenericView implements AfterViewInit {
257257 const pt = this . getXYForTouchEvent ( event ) ;
258258
259259 if ( this . goodDragStart )
260- this . handleDrag ( pt . x , pt . y , true ) ;
260+ this . handleMouseMove ( pt . x , pt . y , true ) ;
261261
262262 if ( this . isInsideView ( ) )
263263 event . preventDefault ( ) ;
264264 }
265265
266266 onMouseMove ( event : MouseEvent ) : void {
267- if ( this . goodDragStart )
268- this . handleDrag ( event . offsetX , event . offsetY , ! ! ( ( event . buttons & 0x01 ) || ( this . isSafari && ( event . which & 0x01 ) ) ) ) ;
267+ if ( this . goodDragStart || ! this . dragging )
268+ this . handleMouseMove ( event . offsetX , event . offsetY , ! ! ( ( event . buttons & 0x01 ) || ( this . isSafari && ( event . which & 0x01 ) ) ) ) ;
269269 }
270270
271- protected handleDrag ( x : number , y : number , button1Down : boolean ) : void {
271+ protected handleMouseMove ( x : number , y : number , button1Down : boolean ) : void {
272272 this . lastMoveX = x ;
273273 this . lastMoveY = y ;
274274
@@ -290,13 +290,13 @@ export abstract class GenericView implements AfterViewInit {
290290 }
291291
292292 if ( ! this . dragging || justCleared ) {
293- if ( ! this . debouncedMouseMove ) {
294- this . debouncedMouseMove = _ . debounce ( ( ) => {
293+ if ( ! this . throttledMouseMove ) {
294+ this . throttledMouseMove = _ . throttle ( ( ) => {
295295 this . draw ( ) ;
296296 } , 100 ) ;
297297 }
298298
299- this . debouncedMouseMove ( ) ;
299+ this . throttledMouseMove ( ) ;
300300 }
301301 }
302302
0 commit comments