Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-29 12:13:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-29 12:13:32 +0400
commitf6527043d9fd12fd9d9281d45ddbd1b0c3d5997e (patch)
tree9976c4120f35af1ac22cb29e2902d6956da0a551 /source/blender/editors/space_text/text_ops.c
parent73068ca3df352ffceb898086cea3f62139e4d494 (diff)
fix for glitch where the text editor could be clamped to scroll above line 1 (would flicker on scroll).
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r--source/blender/editors/space_text/text_ops.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index dec61a0e1ca..d4ebd6f273b 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -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 */