mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[textarea] Do not allow fs->vpos to be negative. Refs #126
It is rather a workaround.
This commit is contained in:
parent
12bb1ebbfa
commit
a0eb60d4bc
@ -276,6 +276,8 @@ area_cursor(struct el_form_control *fc, struct form_state *fs, int utf8)
|
||||
int_bounds(&fs->vpos, x - fc->cols + 1, x);
|
||||
int_bounds(&fs->vypos, y - fc->rows + 1, y);
|
||||
|
||||
if (fs->vpos < 0) fs->vpos = 0;
|
||||
|
||||
x -= fs->vpos;
|
||||
y -= fs->vypos;
|
||||
|
||||
@ -311,6 +313,8 @@ area_cursor(struct el_form_control *fc, struct form_state *fs)
|
||||
int_bounds(&fs->vpos, x - fc->cols + 1, x);
|
||||
int_bounds(&fs->vypos, y - fc->rows + 1, y);
|
||||
|
||||
if (fs->vpos < 0) fs->vpos = 0;
|
||||
|
||||
x -= fs->vpos;
|
||||
y -= fs->vypos;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user