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

Unified Diff: ui/gfx/geometry/quad_f.h

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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 | « ui/gfx/BUILD.gn ('k') | ui/gfx/hud_font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/quad_f.h
diff --git a/ui/gfx/geometry/quad_f.h b/ui/gfx/geometry/quad_f.h
index ada5c54cae3fdb521db8e50f52c49eb408892b9d..d7950645ce28f6366e5d147ba92e78852c831dd8 100644
--- a/ui/gfx/geometry/quad_f.h
+++ b/ui/gfx/geometry/quad_f.h
@@ -10,6 +10,7 @@
#include <iosfwd>
#include <string>
+#include "base/logging.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/gfx_export.h"
@@ -67,6 +68,18 @@ class GFX_EXPORT QuadF {
return RectF(rl, rt, rr - rl, rb - rt);
}
+ // Realigns the corners in the quad by rotating them n corners to the right.
+ void Realign(size_t times) {
+ DCHECK_LE(times, 4u);
+ for (size_t i = 0; i < times; ++i) {
+ PointF temp = p1_;
+ p1_ = p2_;
+ p2_ = p3_;
+ p3_ = p4_;
+ p4_ = temp;
+ }
+ }
+
// Add a vector to the quad, offseting each point in the quad by the vector.
void operator+=(const Vector2dF& rhs);
// Subtract a vector from the quad, offseting each point in the quad by the
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/hud_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698