fix for glitch where the text editor could be clamped to scroll above line 1 (would flicker on scroll).

This commit is contained in:
Campbell Barton 2013-08-29 08:13:32 +00:00
parent 73068ca3df
commit f6527043d9

@ -2086,10 +2086,17 @@ void TEXT_OT_overwrite_toggle(wmOperatorType *ot)
static void txt_screen_clamp(SpaceText *st, ARegion *ar)
{
int last;
last = text_get_total_lines(st, ar);
last = last - (st->viewlines / 2);
CLAMP(st->top, 0, last);
if (st->top < 0) {
st->top = 0;
}
else {
int last;
last = text_get_total_lines(st, ar);
last = last - (st->viewlines / 2);
if (last > 0 && st->top > last) {
st->top = last;
}
}
}
/* Moves the view vertically by the specified number of lines */