Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js

Issue 1996013004: DevTools: better SensorsView orientation fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/common/Geometry.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js b/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
index a944b761f53b050307c778e32f60715b53792947..1ed0f00810b616eac747ba7133edfb43d45f923c 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
@@ -253,7 +253,7 @@ WebInspector.SensorsView.prototype = {
*/
function roundAngle(angle)
{
- return Math.round(angle*10000)/10000;
+ return Math.round(angle * 10000) / 10000;
}
if (modificationSource != WebInspector.SensorsView.DeviceOrientationModificationSource.UserInput) {
@@ -321,9 +321,10 @@ WebInspector.SensorsView.prototype = {
else
this._stageElement.classList.remove("is-animating");
+ // The CSS transform should not depend on matrix3d, which does not interpolate well.
var matrix = new WebKitCSSMatrix();
this._boxMatrix = matrix.rotate(-deviceOrientation.beta, deviceOrientation.gamma, -deviceOrientation.alpha);
- var eulerAngles = WebInspector.Geometry.EulerAngles.fromRotationMatrix(this._boxMatrix);
+ var eulerAngles = new WebInspector.Geometry.EulerAngles(deviceOrientation.alpha, deviceOrientation.beta, deviceOrientation.gamma);
this._orientationLayer.style.transform = eulerAngles.toRotate3DString();
},
@@ -341,7 +342,7 @@ WebInspector.SensorsView.prototype = {
var axis, angle;
if (event.shiftKey) {
axis = new WebInspector.Geometry.Vector(0, 0, -1);
- angle = (this._mouseDownVector.x - mouseMoveVector.x)*WebInspector.SensorsView.ShiftDragOrientationSpeed;
+ angle = (this._mouseDownVector.x - mouseMoveVector.x) * WebInspector.SensorsView.ShiftDragOrientationSpeed;
} else {
axis = WebInspector.Geometry.crossProduct(this._mouseDownVector, mouseMoveVector);
angle = WebInspector.Geometry.calculateAngle(this._mouseDownVector, mouseMoveVector);
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/common/Geometry.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698