diff options
author | KatolaZ <katolaz@freaknet.org> | 2019-08-01 16:42:36 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2019-08-01 16:42:36 +0100 |
commit | 82a7c12e8338288ccb40d213fcc9e15d102aa968 (patch) | |
tree | 970ca2f39dc599624e53a10e59d05bc908f9b0a2 /draw.c | |
parent | 62713aaf65264950aecad9237d50e911d7dad893 (diff) |
remove trailing blank lines in write_file - change check_bound
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 33 |
1 files changed, 17 insertions, 16 deletions
@@ -94,7 +94,7 @@ void get_text(FILE *fc){ if (x >= WIDTH) x = orig_x; } - check_bound(); + check_bound(&x, &y); status_bar(); show_cursor(); } @@ -150,7 +150,7 @@ void get_box(FILE *fc){ goto update_box; if (!move_around(c, fc)) continue; - check_bound(); + check_bound(&x, &y); redraw(); step = 1; update_box: @@ -166,19 +166,19 @@ update_box: mode = MOVE; } -void draw_arrow(int x, int y, char *a, int a_len, int fix){ +void draw_arrow(int xl, int yl, char *a, int a_len, int fix){ int i, j, cur_dir; char line; void (*f)(int, int, char); - a_miny = a_maxy = y; + a_miny = a_maxy = yl; if (fix == FIX) f = set_xy; else f = draw_xy; - f(x,y,mark_st); + f(xl, yl, mark_st); if (!a_len){ show_cursor(); return; @@ -189,27 +189,28 @@ void draw_arrow(int x, int y, char *a, int a_len, int fix){ /* If we are switching between horizontal and vertical, put a "corner" */ if (((cur_dir & DIR_HOR) && (a[i] & DIR_VER)) || ((cur_dir & DIR_VER) && (a[i] & DIR_HOR))){ - f(x,y,corner); + f(xl, yl, corner); show_cursor(); } } for(j=0; j<a[i+1]; j++){ 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); + xl += progr_x(a[i]); + yl += progr_y(a[i]); + check_bound(&xl, &yl); + if (yl < a_miny) a_miny = yl; + if (yl > a_maxy) a_maxy = yl; + f(xl, yl, line); } /* f(x,y,mark_end);*/ cur_dir = a[i]; } if (autoend){ if (cur_dir != DIR_N) - f(x,y, get_mark(cur_dir)); + f(xl,yl, get_mark(cur_dir)); } else - f(x,y,mark_end); + f(xl,yl,mark_end); show_cursor(); } @@ -235,7 +236,7 @@ void get_arrow(FILE *fc){ goto update_arrow; if (!move_around(c, fc)) continue; - check_bound(); + check_bound(&x, &y); /* FIXME: if we are out of bound, do nothing? */ if (arrow_len == arrow_sz){ arrow_sz *=2; @@ -289,7 +290,7 @@ void erase(FILE *fc){ show_cursor(); while((c=fgetc(fc))!=EOF && c!=27 && c!= 'x' && c != '\n'){ if (!move_around(c, fc)) continue; - check_bound(); + check_bound(&x, &y); if (first || (y != orig_y && ! opened) || (y == orig_y && x != orig_x && !opened) ){ @@ -354,7 +355,7 @@ void visual_box(FILE *fc){ goto vis_exit; break; } - check_bound(); + check_bound(&x, &y); set_video(VIDEO_NRM); redraw(); step = 1; |