Index: ui/gfx/render_text.cc |
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc |
index 87e650b8cf3107637f407cad49850905f17fac68..cae8b7130b0a7dbc76c58d278a326f7a08e80a46 100644 |
--- a/ui/gfx/render_text.cc |
+++ b/ui/gfx/render_text.cc |
@@ -722,7 +722,8 @@ SizeF RenderText::GetStringSizeF() { |
} |
float RenderText::GetContentWidth() { |
- return GetStringSizeF().width() + (cursor_enabled_ ? 1 : 0); |
+ return cursor_enabled_ ? |
msw
2014/11/24 21:51:00
This change seems hinge on the cursor painting 1px
ckocagil
2014/11/25 01:39:47
Correct.
|
+ GetStringSize().width() + 1 : GetStringSizeF().width(); |
} |
int RenderText::GetBaseline() { |
@@ -1071,7 +1072,7 @@ Vector2d RenderText::GetAlignmentOffset(size_t line_number) { |
HorizontalAlignment horizontal_alignment = GetCurrentHorizontalAlignment(); |
if (horizontal_alignment != ALIGN_LEFT) { |
#if defined(OS_WIN) |
- const int width = lines_[line_number].size.width() + |
+ const int width = std::ceil(lines_[line_number].size.width()) + |
(cursor_enabled_ ? 1 : 0); |
#else |
const int width = GetContentWidth(); |