From 2d7ac9e737f37daf8490c27e6a04c65bba642645 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 8 Feb 2013 15:19:14 +0000 Subject: xlib: Only apply the dst offset to the glyph strings once The elts offset is a delta from the previous glyph coordinate. So by subtracting the dst origin everytime, we were accumulating a glyph position error. Instead we just want to offset the starting coordinate and then always use relative positions. Reported-by: Theo Veenker Signed-off-by: Chris Wilson --- src/cairo-xlib-render-compositor.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c index 12f357de..013e2aff 100644 --- a/src/cairo-xlib-render-compositor.c +++ b/src/cairo-xlib-render-compositor.c @@ -1469,14 +1469,14 @@ _emit_glyphs_chunk (cairo_xlib_display_t *display, */ if (_start_new_glyph_elt (j, &glyphs[i])) { if (j) { - elts[nelt].nchars = n; - nelt++; - n = 0; + elts[nelt].nchars = n; + nelt++; + n = 0; } elts[nelt].chars = char8 + size * j; elts[nelt].glyphset = info->glyphset; - elts[nelt].xOff = glyphs[i].i.x - dst_x; - elts[nelt].yOff = glyphs[i].i.y - dst_y; + elts[nelt].xOff = glyphs[i].i.x; + elts[nelt].yOff = glyphs[i].i.y; } switch (width) { @@ -1579,7 +1579,7 @@ composite_glyphs (void *surface, cairo_xlib_display_t *display = dst->display; cairo_int_status_t status = CAIRO_INT_STATUS_SUCCESS; cairo_scaled_glyph_t *glyph; - cairo_fixed_t x = 0, y = 0; + cairo_fixed_t x = dst_x, y = dst_y; cairo_xlib_font_glyphset_t *glyphset = NULL, *this_glyphset_info; unsigned long max_index = 0; -- cgit v1.2.3