mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-27 02:03:26 +01:00
fix line scrolling bug
This commit is contained in:
parent
3740cb6763
commit
70e8bdb409
@ -157,8 +157,11 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
|
|||||||
/* y distance between pos and len */
|
/* y distance between pos and len */
|
||||||
int d = prt->pos < (prt->len - px2) ? (y2 - y - 1) : 0;
|
int d = prt->pos < (prt->len - px2) ? (y2 - y - 1) : 0;
|
||||||
|
|
||||||
|
/* 1 if end of line is touching bottom of window, 0 otherwise */
|
||||||
|
int bot = prt->orig_y + ((prt->len + p_ofst) / px2) == y2;
|
||||||
|
|
||||||
/* move point of line origin up when input scrolls screen down */
|
/* move point of line origin up when input scrolls screen down */
|
||||||
if ( (prt->scroll) && (y + d == y2-1) && ((prt->len + p_ofst) % px2 == 0) ) {
|
if (prt->scroll && (y + d == y2 - bot) && ((prt->len + p_ofst) % px2 == 0) ) {
|
||||||
--prt->orig_y;
|
--prt->orig_y;
|
||||||
prt->scroll = false;
|
prt->scroll = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user