Chromium Code Reviews| Index: ui/gfx/render_text.cc |
| diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc |
| index fb7364b66f2b538f5733867b11afc11330755c6d..62ed10bb560d03e89abd1126e1a314ed5aeea49c 100644 |
| --- a/ui/gfx/render_text.cc |
| +++ b/ui/gfx/render_text.cc |
| @@ -1342,9 +1342,11 @@ void RenderText::UpdateCachedBoundsAndOffset() { |
| // Reduce the pan offset to show additional overflow text when the display |
| // width increases. |
| const int negate_rtl = horizontal_alignment_ == ALIGN_RIGHT ? -1 : 1; |
|
msw
2014/07/11 22:33:04
nit: consider combining the two scale factors.
|
| - const int offset = negate_rtl * display_offset_.x(); |
| + const int double_center = horizontal_alignment_ == ALIGN_CENTER ? 2 : 1; |
|
msw
2014/07/11 22:33:04
nit: consider |scale_center|
|
| + const int offset = negate_rtl * double_center * display_offset_.x(); |
| if (display_width > (content_width + offset)) { |
|
msw
2014/07/11 22:33:04
I don't think this condition will capture all the
mohsen
2014/07/14 20:57:01
In your example, no extra empty space will be show
msw
2014/07/16 01:41:43
I think this is wrong, the alignment offset
|
| - delta_x = negate_rtl * (display_width - (content_width + offset)); |
| + delta_x = negate_rtl * (display_width - (content_width + offset)) / |
| + double_center; |
| } |
| } |