Index: ui/gfx/render_text.cc |
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc |
index fe4c59cee9b3239dd18b982628203b55a885b9f6..e0da64d683c69c3b966b54340d8a809be46fdc04 100644 |
--- a/ui/gfx/render_text.cc |
+++ b/ui/gfx/render_text.cc |
@@ -651,7 +651,10 @@ void RenderText::SetStyle(TextStyle style, bool value) { |
} |
void RenderText::ApplyStyle(TextStyle style, bool value, const Range& range) { |
- styles_[style].ApplyValue(value, range); |
+ // Don't change style in the middle of grapheme to avoid breaking of ligature. |
msw
2014/09/03 19:17:32
nit: "Do not change styles mid-grapheme to avoid b
|
+ const size_t corrected_end = |
msw
2014/09/03 19:17:32
We should only correct the range bounds as needed:
|
+ IndexOfAdjacentGrapheme(range.end() - 1, CURSOR_FORWARD); |
+ styles_[style].ApplyValue(value, Range(range.start(), corrected_end)); |
msw
2014/09/03 19:17:32
We should also correct the range start (using CURS
|
cached_bounds_and_offset_valid_ = false; |
ResetLayout(); |