Skip to content

Commit 1b8897a

Browse files
authored
Merge branch 'master' into master
2 parents 75edf44 + e55eaac commit 1b8897a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

android/src/main/java/com/joshblour/reactnativeheading/ReactNativeHeadingModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ public void onSensorChanged(SensorEvent event) {
8383
// calculate th rotation matrix
8484
SensorManager.getRotationMatrixFromVector(rMat, event.values);
8585
// get the azimuth value (orientation[0]) in degree
86+
8687
newAzimuth = (int) ((((( Math.toDegrees( SensorManager.getOrientation( rMat, orientation )[0] ) + 360 ) % 360) -
8788
( Math.toDegrees( SensorManager.getOrientation( rMat, orientation )[2] ))) +360) % 360);
89+
8890
//dont react to changes smaller than the filter value
8991
if (Math.abs(mAzimuth - newAzimuth) < mFilter) {
9092
return;

0 commit comments

Comments
 (0)