Skip to content

Commit d5be055

Browse files
author
Steve Block
committed
Fix alpha value for device orientation
This seems to have been incorrect since this code was first written for HC. I can only think that the error was made due to confusion between portrait and landscape mode as development switched from phones to tablets. Tested on stingray and prime. A similar fix will be required for Chrome. Change-Id: I5da13c489fdb9de340b9e6ea8868c9f1adc15bb2
1 parent 58de142 commit d5be055

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/java/android/webkit/DeviceOrientationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void getOrientationUsingGetRotationMatrix() {
123123
// The angles are in radians
124124
float[] rotationAngles = new float[3];
125125
SensorManager.getOrientation(deviceRotationMatrix, rotationAngles);
126-
double alpha = Math.toDegrees(-rotationAngles[0]) - 90.0;
126+
double alpha = Math.toDegrees(-rotationAngles[0]);
127127
while (alpha < 0.0) { alpha += 360.0; } // [0, 360)
128128
double beta = Math.toDegrees(-rotationAngles[1]);
129129
while (beta < -180.0) { beta += 360.0; } // [-180, 180)

0 commit comments

Comments
 (0)