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

Unified Diff: ash/launcher/launcher_view.cc

Issue 14574009: Use correctly mirrored points for ideal bounds of launcher item icons. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use INSTANTIATE_TEST_CASE_P Created 7 years, 7 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 | « no previous file | ash/launcher/launcher_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_view.cc
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index ead087924d3bf0044ba5398ebc7f7498422ee3f7..1326c758b8996ed2a7d0179c5858eb02992f1ba3 100644
--- a/ash/launcher/launcher_view.cc
+++ b/ash/launcher/launcher_view.cc
@@ -472,7 +472,8 @@ gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) {
LauncherButton* button =
static_cast<LauncherButton*>(view_model_->view_at(index));
gfx::Rect icon_bounds = button->GetIconBounds();
- return gfx::Rect(ideal_bounds.x() + icon_bounds.x(),
+ return gfx::Rect(GetMirroredXWithWidthInView(
+ ideal_bounds.x() + icon_bounds.x(), icon_bounds.width()),
ideal_bounds.y() + icon_bounds.y(),
icon_bounds.width(),
icon_bounds.height());
@@ -485,19 +486,21 @@ void LauncherView::UpdatePanelIconPosition(LauncherID id,
if (current_index < first_panel_index)
return;
+ gfx::Point midpoint_in_view(GetMirroredXInView(midpoint.x()),
+ midpoint.y());
ShelfLayoutManager* shelf = tooltip_->shelf_layout_manager();
int target_index = current_index;
while (target_index > first_panel_index &&
shelf->PrimaryAxisValue(view_model_->ideal_bounds(target_index).x(),
view_model_->ideal_bounds(target_index).y()) >
- shelf->PrimaryAxisValue(midpoint.x(), midpoint.y())) {
+ shelf->PrimaryAxisValue(midpoint_in_view.x(), midpoint_in_view.y())) {
--target_index;
}
while (target_index < view_model_->view_size() - 1 &&
shelf->PrimaryAxisValue(
view_model_->ideal_bounds(target_index).right(),
view_model_->ideal_bounds(target_index).bottom()) <
- shelf->PrimaryAxisValue(midpoint.x(), midpoint.y())) {
+ shelf->PrimaryAxisValue(midpoint_in_view.x(), midpoint_in_view.y())) {
++target_index;
}
if (current_index != target_index)
« no previous file with comments | « no previous file | ash/launcher/launcher_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698