Chromium Code Reviews| Index: ui/views/bubble/bubble_border.cc |
| diff --git a/ui/views/bubble/bubble_border.cc b/ui/views/bubble/bubble_border.cc |
| index 0cc3b3a0cda898cd441b7e09f78871cee1cf6975..35614bc149cb400c762a4129eb4997b60aeef08a 100644 |
| --- a/ui/views/bubble/bubble_border.cc |
| +++ b/ui/views/bubble/bubble_border.cc |
| @@ -188,17 +188,21 @@ void BubbleBorder::set_paint_arrow(ArrowPaintType value) { |
| gfx::Rect BubbleBorder::GetBounds(const gfx::Rect& anchor_rect, |
| const gfx::Size& contents_size) const { |
| - if (UseMd()) { |
| + if (UseMd() && (arrow_ == TOP_RIGHT || arrow_ == TOP_LEFT)) { |
| // In MD, there are no arrows, so positioning logic is significantly |
| // simpler. |
| // TODO(estade): handle more anchor positions. |
| + gfx::Rect contents_bounds(contents_size); |
| if (arrow_ == TOP_RIGHT) { |
| - gfx::Rect contents_bounds(contents_size); |
| contents_bounds += |
| anchor_rect.bottom_right() - contents_bounds.top_right(); |
| - contents_bounds.Inset(-GetInsets()); |
| - return contents_bounds; |
| } |
| + if (arrow_ == TOP_LEFT) { |
|
sky
2016/09/29 03:19:54
Does this do the right thing for rtl?
Evan Stade
2016/09/29 17:27:53
yes
|
| + contents_bounds += |
| + anchor_rect.bottom_left() - contents_bounds.origin(); |
| + } |
| + contents_bounds.Inset(-GetInsets()); |
| + return contents_bounds; |
| } |
| int x = anchor_rect.x(); |