1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[textarea] Do not allow fs->vpos to be negative. Refs #126

It is rather a workaround.
This commit is contained in:
Witold Filipczyk 2021-09-01 19:56:47 +02:00
parent 12bb1ebbfa
commit a0eb60d4bc

View File

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