Trim wide text properly at the RH edge of the screen.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 15 Oct 2002 09:30:16 +0000 (09:30 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 15 Oct 2002 09:30:16 +0000 (09:30 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@2055 cda61777-01e9-0310-a592-d414129be87e

unix/pterm.c

index e6446a0..58f9846 100644 (file)
@@ -1067,9 +1067,11 @@ void do_text(Context ctx, int x, int y, char *text, int len,
     }
 
     if (lattr != LATTR_NORM) {
-       if (x*2 >= cols)
-           return;
        x *= 2;
+       if (x >= cols)
+           return;
+       if (x + len*2 > cols)
+           len = (cols-x)/2;          /* trim to LH half */
     }
 
     gdk_gc_set_foreground(gc, &inst->cols[nbg]);