[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59627] trunk/blender/source/blender/ editors/space_text/text_ops.c: fix for glitch where the text editor could be clamped to scroll above line 1 (would flicker on scroll).

Campbell Barton ideasman42 at gmail.com
Thu Aug 29 10:13:33 CEST 2013


Revision: 59627
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59627
Author:   campbellbarton
Date:     2013-08-29 08:13:32 +0000 (Thu, 29 Aug 2013)
Log Message:
-----------
fix for glitch where the text editor could be clamped to scroll above line 1 (would flicker on scroll).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_text/text_ops.c

Modified: trunk/blender/source/blender/editors/space_text/text_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_ops.c	2013-08-29 06:02:19 UTC (rev 59626)
+++ trunk/blender/source/blender/editors/space_text/text_ops.c	2013-08-29 08:13:32 UTC (rev 59627)
@@ -2086,10 +2086,17 @@
 
 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 */




More information about the Bf-blender-cvs mailing list