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

Unified Diff: ui/gfx/rect_base.h

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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/rect.h ('k') | ui/gfx/rect_base_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect_base.h
diff --git a/ui/gfx/rect_base.h b/ui/gfx/rect_base.h
index 08c9121eec142f197de25c407e555dd7bdd482c5..a9ddda4b43f1e0cfddd41ec16c19fc758fba64fd 100644
--- a/ui/gfx/rect_base.h
+++ b/ui/gfx/rect_base.h
@@ -100,31 +100,31 @@ class UI_EXPORT RectBase {
bool Intersects(const Class& rect) const;
// Computes the intersection of this rectangle with the given rectangle.
- Class Intersect(const Class& rect) const WARN_UNUSED_RESULT;
+ void Intersect(const Class& rect);
// Computes the union of this rectangle with the given rectangle. The union
// is the smallest rectangle containing both rectangles.
- Class Union(const Class& rect) const WARN_UNUSED_RESULT;
+ void Union(const Class& rect);
// Computes the rectangle resulting from subtracting |rect| from |this|. If
// |rect| does not intersect completely in either the x- or y-direction, then
- // |*this| is returned. If |rect| contains |this|, then an empty Rect is
- // returned.
- Class Subtract(const Class& rect) const WARN_UNUSED_RESULT;
+ // |*this| does not change. If |rect| contains |this|, then an empty Rect is
+ // the result.
+ void Subtract(const Class& rect);
// Fits as much of the receiving rectangle into the supplied rectangle as
- // possible, returning the result. For example, if the receiver had
+ // possible, becoming the result. For example, if the receiver had
// a x-location of 2 and a width of 4, and the supplied rectangle had
// an x-location of 0 with a width of 5, the returned rectangle would have
// an x-location of 1 with a width of 4.
- Class AdjustToFit(const Class& rect) const WARN_UNUSED_RESULT;
+ void AdjustToFit(const Class& rect);
// Returns the center of this rectangle.
PointClass CenterPoint() const;
- // Return a rectangle that has the same center point but with a size capped
+ // Becomes a rectangle that has the same center point but with a size capped
// at given |size|.
- Class Center(const SizeClass& size) const WARN_UNUSED_RESULT;
+ void ClampToCenteredSize(const SizeClass& size);
// Splits |this| in two halves, |left_half| and |right_half|.
void SplitVertically(Class* left_half, Class* right_half) const;
« no previous file with comments | « ui/gfx/rect.h ('k') | ui/gfx/rect_base_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698