From 828ad5d6d4b4ddcdfdf995b01723f5cfe8bbf371 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 16 Aug 2015 08:55:04 +0100 Subject: [PATCH] Call draw_stretch_before *after* setting up the clip region. A small bug in yesterday's work: since in Cairo mode draw_stretch_before changes the transformation matrix, if we do it before calling draw_clip then the clip region will be interpreted in the transformed coordinates. This caused a subtle display bug in yesterday's commit: drawing one half of double-height text would have drawn _both_ halves of it on to the window's backing pixmap, but only copied the correct half on to the window proper - but the overdrawing on the pixmap would have shown up if the window was hidden and re-exposed. --- unix/gtkwin.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 82cb4994..c62bddb4 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -2635,6 +2635,12 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len, } else rlen = len; + draw_clip(dctx, + x*inst->font_width+inst->window_border, + y*inst->font_height+inst->window_border, + rlen*widefactor*inst->font_width, + inst->font_height); + if ((lattr & LATTR_MODE) != LATTR_NORM) { draw_stretch_before(dctx, x*inst->font_width+inst->window_border, @@ -2645,12 +2651,6 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len, ((lattr & LATTR_MODE) == LATTR_BOT)); } - draw_clip(dctx, - x*inst->font_width+inst->window_border, - y*inst->font_height+inst->window_border, - rlen*widefactor*inst->font_width, - inst->font_height); - draw_set_colour(dctx, nbg); draw_rectangle(dctx, TRUE, x*inst->font_width+inst->window_border,