From 631a45ecb580aae181190ed4a2954b15ab3bbeb5 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 28 Sep 2008 20:34:22 +0000 Subject: [PATCH] Calculate y properly. --- TODO | 1 - grid-view.c | 4 +++- grid.c | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index aed7d5ab..5f48bc43 100644 --- a/TODO +++ b/TODO @@ -36,7 +36,6 @@ -- For 0.5 -------------------------------------------------------------------- - audit for leftover/unused code -21:09 < merdely> NicM: if I run 'tmux attach -t main' and there is no tmux session named main, start a new one. - commands: save-buffer -b number filename load-buffer -b number filename copy-buffer -s src-session -t dst-session diff --git a/grid-view.c b/grid-view.c index cb532110..1adfc454 100644 --- a/grid-view.c +++ b/grid-view.c @@ -1,4 +1,4 @@ -/* $Id: grid-view.c,v 1.2 2008-09-26 06:45:26 nicm Exp $ */ +/* $Id: grid-view.c,v 1.3 2008-09-28 20:34:22 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -177,6 +177,7 @@ grid_view_insert_cells(struct grid_data *gd, u_int px, u_int py, u_int nx) GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx); px = grid_view_x(gd, px); + py = grid_view_y(gd, py); sx = grid_view_x(gd, gd->sx); @@ -192,6 +193,7 @@ grid_view_delete_cells(struct grid_data *gd, u_int px, u_int py, u_int nx) GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx); px = grid_view_x(gd, px); + py = grid_view_y(gd, py); sx = grid_view_x(gd, gd->sx); diff --git a/grid.c b/grid.c index 941ec919..35ebf975 100644 --- a/grid.c +++ b/grid.c @@ -1,4 +1,4 @@ -/* $Id: grid.c,v 1.2 2008-09-26 06:45:26 nicm Exp $ */ +/* $Id: grid.c,v 1.3 2008-09-28 20:34:22 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -335,10 +335,11 @@ grid_move_cells(struct grid_data *gd, u_int dx, u_int px, u_int py, u_int nx) return; grid_check_x(gd, px); - grid_check_x(gd, px + nx - 1); + grid_check_x(gd, px + nx - 1); + grid_check_x(gd, dx + nx - 1); grid_check_y(gd, py); - grid_expand_line(gd, py ,px + nx); + grid_expand_line(gd, py, px + nx); grid_expand_line(gd, py, dx + nx); memmove(&gd->data[py][dx], &gd->data[py][px], nx * (sizeof **gd->data));