Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1421)

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 923973003: Fix the x-offset calculation when drawing the text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index e4469a6fdfa2500f117317a0b22e84bfac6deb4c..cd03d6809c34a52c5e63fcec79618e3209885f79 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -960,8 +960,9 @@ void RenderTextHarfBuzz::DrawVisualText(Canvas* canvas) {
background_is_transparent());
Range glyphs_range = run.CharRangeToGlyphRange(segment.char_range);
scoped_ptr<SkPoint[]> positions(new SkPoint[glyphs_range.length()]);
- SkScalar offset_x =
- preceding_segment_widths - run.positions[glyphs_range.start()].x();
+ SkScalar offset_x = preceding_segment_widths -
msw 2015/02/14 04:22:34 Hmm, I wonder if this is actually correct, or if r
Jun Mukai 2015/02/17 21:24:21 Thanks, you are right. My intension was: - if a se
+ run.positions[glyphs_range.start()].x() +
+ run.positions[0].x();
for (size_t j = 0; j < glyphs_range.length(); ++j) {
positions[j] = run.positions[(glyphs_range.is_reversed()) ?
(glyphs_range.start() - j) :
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698