summaryrefslogtreecommitdiffstats
path: root/ui/app_list
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 22:52:18 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 22:52:18 +0000
commitce112fe17067812a9014c6b10e041435aedf9998 (patch)
tree45e32fbd98173f5aae7bc2fd417d67d4461570f4 /ui/app_list
parentaa1c70d3bc9449db2a3bfd02c15875aafb17caa5 (diff)
downloadchromium_src-ce112fe17067812a9014c6b10e041435aedf9998.zip
chromium_src-ce112fe17067812a9014c6b10e041435aedf9998.tar.gz
chromium_src-ce112fe17067812a9014c6b10e041435aedf9998.tar.bz2
Add non-member non-mutating methods for common gfx::Rect operations.
This adds non-member methods that return a new Rect (or RectF) object as their result instead of mutating an existing rect. We add: Rect gfx::IntersectRects(Rect, Rect) RectF gfx::IntersectRects(RectF, RectF) Rect gfx::UnionRects(Rect, Rect) RectF gfx::UnionRects(RectF, RectF) Rect gfx::SubtractRects(Rect, Rect) RectF gfx::SubtractRects(RectF, RectF) RectF gfx::ScaleRect(RectF, scale) RectF gfx::ScaleRect(RectF, x_scale, y_scale) In CL https://codereview.chromium.org/11110004/ we made all member methods of Rect (and RectF) mutate the existing object, so these methods are added for cases where we want the result to create a new object instead. BUG=147395 R=sky Review URL: https://codereview.chromium.org/11270042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164760 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list')
-rw-r--r--ui/app_list/page_switcher.cc3
-rw-r--r--ui/app_list/search_result_view.cc3
2 files changed, 2 insertions, 4 deletions
diff --git a/ui/app_list/page_switcher.cc b/ui/app_list/page_switcher.cc
index ba98671..1517d39 100644
--- a/ui/app_list/page_switcher.cc
+++ b/ui/app_list/page_switcher.cc
@@ -189,8 +189,7 @@ void PageSwitcher::Layout() {
rect.y(),
buttons_size.width(),
rect.height());
- rect.Intersect(buttons_bounds);
- buttons_->SetBoundsRect(rect);
+ buttons_->SetBoundsRect(gfx::IntersectRects(rect, buttons_bounds));
}
void PageSwitcher::CalculateButtonWidthAndSpacing(int contents_width) {
diff --git a/ui/app_list/search_result_view.cc b/ui/app_list/search_result_view.cc
index 7e4559d..eb6547d 100644
--- a/ui/app_list/search_result_view.cc
+++ b/ui/app_list/search_result_view.cc
@@ -200,8 +200,7 @@ void SearchResultView::OnPaint(gfx::Canvas* canvas) {
canvas->FillRect(content_rect, kHoverAndPushedColor);
}
- gfx::Rect border_bottom(rect);
- border_bottom.Subtract(content_rect);
+ gfx::Rect border_bottom = gfx::SubtractRects(rect, content_rect);
canvas->FillRect(border_bottom,
selected ? kSelectedBorderColor : kBorderColor);