File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export abstract class StateBase implements IStateBase {
4141 constructor ( state : IStateBase ) {
4242 this . _spatial = new Spatial ( ) ;
4343
44- this . _referenceThreshold = 0.01 ;
44+ this . _referenceThreshold = 300 ;
4545 this . _transitionMode = state . transitionMode ;
4646
4747 this . _reference = state . reference ;
@@ -312,13 +312,19 @@ export abstract class StateBase implements IStateBase {
312312 }
313313
314314 private _setReference ( image : Image ) : boolean {
315+ const distance = this . _spatial . distanceFromLngLat (
316+ image . lngLat . lng ,
317+ image . lngLat . lat ,
318+ this . reference . lng ,
319+ this . reference . lat ) ;
320+
315321 // do not reset reference if image is within threshold distance
316- if ( Math . abs ( image . lngLat . lat - this . reference . lat ) < this . _referenceThreshold &&
317- Math . abs ( image . lngLat . lng - this . reference . lng ) < this . _referenceThreshold ) {
322+ if ( distance < this . _referenceThreshold ) {
318323 return false ;
319324 }
320325
321- // do not reset reference if previous image exist and transition is with motion
326+ // do not reset reference if previous image exist and
327+ // transition is with motion
322328 if ( this . _previousImage != null && ! this . _motionlessTransition ( ) ) {
323329 return false ;
324330 }
You can’t perform that action at this time.
0 commit comments