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

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

Issue 2744423002: Handle large rects better. (Closed)
Patch Set: Add comment and change constant reference. Created 3 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 | « cc/trees/layer_tree_host_common_unittest.cc ('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 8c37e8eeabd11cafdc2c0f43cad20bbac1f9f0f3..1858d44d2c765537100072f4f0d845c91d2d2c9e 100644
--- a/ui/gfx/geometry/rect.h
+++ b/ui/gfx/geometry/rect.h
@@ -110,6 +110,11 @@ class GFX_EXPORT Rect {
set_height(height);
}
+ // Use in place of SetRect() when you know the edges of the rectangle instead
+ // of the dimensions, rather than trying to determine the width/height
+ // yourself. This safely handles cases where the width/height would overflow.
+ void SetByBounds(int left, int top, int right, int bottom);
+
// Shrink the rectangle by a horizontal and vertical distance on all sides.
void Inset(int horizontal, int vertical) {
Inset(horizontal, vertical, horizontal, vertical);
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | ui/gfx/geometry/rect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698