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

Unified Diff: ui/gfx/rect_f.h

Issue 11364054: ui: Add IsExpressibleAsRect() method to RectF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 years, 1 month 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 | « no previous file | ui/gfx/rect_f.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect_f.h
diff --git a/ui/gfx/rect_f.h b/ui/gfx/rect_f.h
index 499c9be4908eecedcb79ee5346e31ecdab1dd972..b3734f960995474c02b4ac1b2d3c323e11c584e3 100644
--- a/ui/gfx/rect_f.h
+++ b/ui/gfx/rect_f.h
@@ -40,6 +40,12 @@ class UI_EXPORT RectF
set_size(newSize);
}
+ // This method reports if the RectF can be safely converted to an integer
+ // Rect. When it is false, some dimension of the RectF is outside the bounds
+ // of what an integer can represent, and converting it to a Rect will require
+ // clamping.
+ bool IsExpressibleAsRect() const;
+
std::string ToString() const;
};
« no previous file with comments | « no previous file | ui/gfx/rect_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698