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

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

Issue 1877043003: [EXPERIMENT] MacViews: Implement Tab Dragging Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 8 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/base/test/ui_controls_mac.mm ('k') | ui/gfx/geometry/rect.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/rect.h
diff --git a/ui/gfx/geometry/rect.h b/ui/gfx/geometry/rect.h
index a01e719882df5c6e2d6a150cde7619052f0cfbc6..6f7b296d39d54d317bd5f305bdf65434ef34b644 100644
--- a/ui/gfx/geometry/rect.h
+++ b/ui/gfx/geometry/rect.h
@@ -270,6 +270,10 @@ inline Rect ScaleToEnclosedRect(const Rect& rect, float scale) {
return ScaleToEnclosedRect(rect, scale, scale);
}
+// Will make the |p| fit inside |rect|, along the ledge that was closest to its
+// original position.
+GFX_EXPORT Point ConstrainToEnclosingRect(const Rect& rect, const Point& p);
+
// This is declared here for use in gtest-based unit tests but is defined in
// the gfx_test_support target. Depend on that to use this in your unit test.
// This should not be used in production code - call ToString() instead.
« no previous file with comments | « ui/base/test/ui_controls_mac.mm ('k') | ui/gfx/geometry/rect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698