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

Unified Diff: third_party/WebKit/Source/platform/transforms/Rotation.cpp

Issue 2391003004: Fix common axes logic to detect negated axes as not common (Closed)
Patch Set: Update expectation Created 4 years, 2 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
Index: third_party/WebKit/Source/platform/transforms/Rotation.cpp
diff --git a/third_party/WebKit/Source/platform/transforms/Rotation.cpp b/third_party/WebKit/Source/platform/transforms/Rotation.cpp
index 15d08ba7ed5c423bceec1cfef784248999f48239..6b762956978256b9355a3789174a3ed259346be3 100644
--- a/third_party/WebKit/Source/platform/transforms/Rotation.cpp
+++ b/third_party/WebKit/Source/platform/transforms/Rotation.cpp
@@ -82,9 +82,12 @@ bool Rotation::getCommonAxis(const Rotation& a,
return true;
}
+ double dot = a.axis.dot(b.axis);
+ if (dot < 0)
+ return false;
+
double aSquared = a.axis.lengthSquared();
double bSquared = b.axis.lengthSquared();
- double dot = a.axis.dot(b.axis);
double error = std::abs(1 - (dot * dot) / (aSquared * bSquared));
if (error > kAngleEpsilon)
return false;

Powered by Google App Engine
This is Rietveld 408576698