diff options
author | KatolaZ <katolaz@freaknet.org> | 2019-08-01 09:56:13 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2019-08-01 09:56:13 +0100 |
commit | f660595c236a21555d3558dd51afae4a67d651a3 (patch) | |
tree | 87f3703b944f0fa783a8234caa53116f6dd06a55 /draw.c | |
parent | 47996e708ad2ab7e6a18633576c95e93d08e816a (diff) |
add undo in arrow mode
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -173,7 +173,7 @@ void draw_arrow(int x, int y, char *a, int a_len, int fix){ char line; void (*f)(int, int, char); - + a_miny = a_maxy = y; if (fix == FIX) f = set_xy; else @@ -198,6 +198,8 @@ void draw_arrow(int x, int y, char *a, int a_len, int fix){ line = (a[i] & DIR_L) || (a[i] & DIR_R) ? line_h : line_v; x += progr_x(a[i]); y += progr_y(a[i]); + if (y < a_miny) a_miny = y; + if (y > a_maxy) a_maxy = y; f(x, y, line); } /* f(x,y,mark_end);*/ @@ -250,8 +252,9 @@ update_arrow: show_cursor(); } if (c == 'a' || c == '\n'){ - invalidate_undo(); + copy_lines_to_ring(a_miny, a_maxy, PRV_STATE); draw_arrow(orig_x, orig_y, arrow, arrow_len, FIX); + copy_lines_to_ring(a_miny, a_maxy, NEW_STATE); modified = 1; } redraw(); |