Chromium Code Reviews| Index: ui/views/controls/styled_label.cc |
| diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc |
| index 5ad539ff653b6e47973bb0ab61d4f88139be799a..c1e6fc660e338d4c802e195034fcf88549c2d5ea 100644 |
| --- a/ui/views/controls/styled_label.cc |
| +++ b/ui/views/controls/styled_label.cc |
| @@ -353,16 +353,19 @@ gfx::Size StyledLabel::CalculateAndDoLayout(int width, bool dry_run) { |
| // Calculate the size of the optional focus border, and overlap by that |
| // amount. Otherwise, "<a>link</a>," will render as "link ,". |
| gfx::Insets focus_border_insets(label->GetInsets()); |
| - focus_border_insets += -label->View::GetInsets(); |
| + focus_border_insets -= label->View::GetInsets(); |
| const gfx::Size view_size = label->GetPreferredSize(); |
| + gfx::Insets insets = GetInsets(); |
|
Evan Stade
2017/03/06 22:01:29
nit: const
dvadym
2017/03/07 13:22:53
Done.
|
| label->SetBoundsRect(gfx::Rect( |
| gfx::Point( |
| - GetInsets().left() + x - focus_border_insets.left(), |
| - GetInsets().top() + line * line_height - focus_border_insets.top()), |
| + insets.left() + x - focus_border_insets.left(), |
| + insets.top() + line * line_height - focus_border_insets.top()), |
| view_size)); |
| x += view_size.width() - focus_border_insets.width(); |
| used_width = std::max(used_width, x); |
| - total_height = std::max(total_height, label->bounds().bottom()); |
| + total_height = |
| + std::max(total_height, label->bounds().bottom() + insets.bottom() - |
| + focus_border_insets.bottom()); |
| if (!dry_run) |
| AddChildView(label.release()); |