Calculate y properly.

This commit is contained in:
Nicholas Marriott 2008-09-28 20:34:22 +00:00
parent 22ef1a1379
commit 631a45ecb5
3 changed files with 7 additions and 5 deletions

1
TODO
View File

@ -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

View File

@ -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 <nicm@users.sourceforge.net>
@ -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);

7
grid.c
View File

@ -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 <nicm@users.sourceforge.net>
@ -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));