From 345460445973548374c171e30e6add02de1e1922 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 6 Mar 2012 21:05:40 +0000 Subject: [PATCH] xlib: Apply the glyph offset The (dst_x, dst_y) parameters passed to the XRenderCompositeText are misleading and do not perform any adjustment, so we have to do it ourselves. Fixes clip-operator Signed-off-by: Chris Wilson --- src/cairo-xlib-render-compositor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c index 86641b9f4..401313bd5 100644 --- a/src/cairo-xlib-render-compositor.c +++ b/src/cairo-xlib-render-compositor.c @@ -1217,8 +1217,8 @@ _emit_glyphs_chunk (cairo_xlib_display_t *display, } elts[nelt].chars = char8 + size * j; elts[nelt].glyphset = info->glyphset; - elts[nelt].xOff = glyphs[i].i.x; - elts[nelt].yOff = glyphs[i].i.y; + elts[nelt].xOff = glyphs[i].i.x - dst_x; + elts[nelt].yOff = glyphs[i].i.y - dst_y; } switch (width) { @@ -1245,9 +1245,9 @@ _emit_glyphs_chunk (cairo_xlib_display_t *display, src->picture, dst->picture, use_mask ? info->xrender_format : NULL, - src_x + elts[0].xOff, - src_y + elts[0].yOff, - elts[0].xOff - dst_x, elts[0].yOff - dst_y, + src_x + elts[0].xOff + dst_x, + src_y + elts[0].yOff + dst_y, + elts[0].xOff, elts[0].yOff, (XGlyphElt8 *) elts, nelt); if (elts != stack_elts)