aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2020-05-02 16:17:44 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2020-05-02 16:17:44 +0100
commitaf69289e0ea2b4af80206bcde0574358fa1b9169 (patch)
tree6a66f17f4912c48f0160ceb5b84aa936fe2eb391 /tty.c
parentcb1131a29481246c9cb9b68cb8591cc747fcdd9a (diff)
downloadrtmux-af69289e0ea2b4af80206bcde0574358fa1b9169.tar.gz
rtmux-af69289e0ea2b4af80206bcde0574358fa1b9169.tar.bz2
rtmux-af69289e0ea2b4af80206bcde0574358fa1b9169.zip
Clamping to area needs to use the offset without the status line, since that is
where the window offsets are based.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tty.c b/tty.c
index 25a0cd02..388f6f5f 100644
--- a/tty.c
+++ b/tty.c
@@ -987,7 +987,7 @@ static int
tty_clamp_line(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
u_int nx, u_int *i, u_int *x, u_int *rx, u_int *ry)
{
- u_int xoff = ctx->xoff + px;
+ u_int xoff = ctx->rxoff + px;
if (!tty_is_visible(tty, ctx, px, py, nx, 1))
return (0);
@@ -1082,7 +1082,7 @@ tty_clamp_area(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
u_int nx, u_int ny, u_int *i, u_int *j, u_int *x, u_int *y, u_int *rx,
u_int *ry)
{
- u_int xoff = ctx->xoff + px, yoff = ctx->yoff + py;
+ u_int xoff = ctx->rxoff + px, yoff = ctx->ryoff + py;
if (!tty_is_visible(tty, ctx, px, py, nx, ny))
return (0);