Commit f9a16504 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Fix menu positioning bug

Fixes menu positioning miscalculations in MenuController.

Bug: 852153
Change-Id: I494bf3b80e33712d515c1369a0fa1be9e3c3e90b
Reviewed-on: https://chromium-review.googlesource.com/1101966Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567639}
parent 48c3e8e3
......@@ -2245,7 +2245,7 @@ gfx::Rect MenuController::CalculateBubbleMenuBounds(MenuItemView* item,
border_and_shadow_insets.right();
}
// Align the top of the menu with the bottom of the anchor.
if (y < 0) {
if (y < state_.monitor_bounds.y()) {
y = owner_bounds.bottom() - border_and_shadow_insets.top() +
menu_config.touchable_anchor_offset;
}
......@@ -2257,7 +2257,7 @@ gfx::Rect MenuController::CalculateBubbleMenuBounds(MenuItemView* item,
menu_config.touchable_anchor_offset;
y = owner_bounds.origin().y() - border_and_shadow_insets.top();
// Align the left of the menu with the right of the anchor.
if (x < 0) {
if (x < state_.monitor_bounds.x()) {
x = owner_bounds.right() - border_and_shadow_insets.left() +
menu_config.touchable_anchor_offset;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment