]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Call draw_stretch_before *after* setting up the clip region.
authorSimon Tatham <anakin@pobox.com>
Sun, 16 Aug 2015 07:55:04 +0000 (08:55 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 16 Aug 2015 08:08:19 +0000 (09:08 +0100)
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

index 82cb49946518377b1849215d41b43b2fff7ee22f..c62bddb4f00a2c14915229c43291072b7913ae11 100644 (file)
@@ -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,