diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2018-10-18 09:24:15 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2018-10-18 09:24:15 +0100 |
commit | 2dfdb55ace6b0beab4903db630603fef5aa44c57 (patch) | |
tree | 3daf307b7e655b3205caa210d305116b5ee95743 | |
parent | f54f171d5c43a22414caeecbe8a71db44f345b4e (diff) | |
download | rtmux-2dfdb55ace6b0beab4903db630603fef5aa44c57.tar.gz rtmux-2dfdb55ace6b0beab4903db630603fef5aa44c57.tar.bz2 rtmux-2dfdb55ace6b0beab4903db630603fef5aa44c57.zip |
Handle pan correctly when the terminal is bigger than the window.
-rw-r--r-- | tty.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -746,10 +746,14 @@ tty_window_offset1(struct tty *tty, u_int *ox, u_int *oy, u_int *sx, u_int *sy) *sy = tty->sy - lines; if (c->pan_window == w) { - if (c->pan_ox + *sx > w->sx) + if (*sx >= w->sx) + c->pan_ox = 0; + else if (c->pan_ox + *sx > w->sx) c->pan_ox = w->sx - *sx; *ox = c->pan_ox; - if (c->pan_oy + *sy > w->sy) + if (*sy >= w->sy) + c->pan_oy = 0; + else if (c->pan_oy + *sy > w->sy) c->pan_oy = w->sy - *sy; *oy = c->pan_oy; return (1); |