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

Unified Diff: ui/gfx/point_conversions.cc

Issue 22891016: Add support for rect-based event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WIP Created 7 years, 3 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: ui/gfx/point_conversions.cc
diff --git a/ui/gfx/point_conversions.cc b/ui/gfx/point_conversions.cc
index f7845a03f41911528d8572304345d0cfe4d9353a..e48116be9bbd4e93ea52ae8e1b741d62ba131d63 100644
--- a/ui/gfx/point_conversions.cc
+++ b/ui/gfx/point_conversions.cc
@@ -14,6 +14,14 @@ Point ToFlooredPoint(const PointF& point) {
return Point(x, y);
}
+Rect ToFlooredRect(const RectF& rect) {
+ int x = ToFlooredInt(rect.x());
+ int y = ToFlooredInt(rect.y());
+ int width = ToFlooredInt(rect.width());
+ int height = ToFlooredInt(rect.height());
+ return Rect(x, y, width, height);
+}
+
Point ToCeiledPoint(const PointF& point) {
int x = ToCeiledInt(point.x());
int y = ToCeiledInt(point.y());

Powered by Google App Engine
This is Rietveld 408576698