1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

Trim wide text properly at the RH edge of the screen.

[originally from svn r2055]
This commit is contained in:
Simon Tatham 2002-10-15 09:30:16 +00:00
parent 74f8f8e8ac
commit b8625a2bf5

View File

@ -1067,9 +1067,11 @@ void do_text(Context ctx, int x, int y, char *text, int len,
} }
if (lattr != LATTR_NORM) { if (lattr != LATTR_NORM) {
if (x*2 >= cols)
return;
x *= 2; 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]); gdk_gc_set_foreground(gc, &inst->cols[nbg]);