[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14234] trunk/blender/source/blender/src/ drawtext.c: Bugfix:

Joshua Leung aligorith at gmail.com
Tue Mar 25 10:17:58 CET 2008


Revision: 14234
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14234
Author:   aligorith
Date:     2008-03-25 10:17:58 +0100 (Tue, 25 Mar 2008)

Log Message:
-----------
Bugfix:

Resizing two text windows stacked one over the other, crashed in certain cases (i.e.  when dragging the border between them down to the header of the bottom one). Was caused by division by zero, resulting in a SIGFPE (floating point exception).

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawtext.c

Modified: trunk/blender/source/blender/src/drawtext.c
===================================================================
--- trunk/blender/source/blender/src/drawtext.c	2008-03-25 09:00:00 UTC (rev 14233)
+++ trunk/blender/source/blender/src/drawtext.c	2008-03-25 09:17:58 UTC (rev 14234)
@@ -772,7 +772,7 @@
 		/* the scrollbar is non-linear sized */
 		if (pix_bardiff > 0) {
 			/* the start of the highlight is in the current viewport */
-			if (lhlstart >= st->top && lhlstart <= st->top + st->viewlines) { 
+			if (ltexth && st->viewlines && lhlstart >= st->top && lhlstart <= st->top + st->viewlines) { 
 				/* speed the progresion of the start of the highlight through the scrollbar */
 				hlstart = ( ( (pix_available - pix_bardiff) * lhlstart) / ltexth) + (pix_bardiff * (lhlstart - st->top) / st->viewlines); 	
 			}
@@ -790,7 +790,7 @@
 			}
 
 			/* the end of the highlight is in the current viewport */
-			if (lhlend >= st->top && lhlend <= st->top + st->viewlines) { 
+			if (ltexth && st->viewlines && lhlend >= st->top && lhlend <= st->top + st->viewlines) { 
 				/* speed the progresion of the end of the highlight through the scrollbar */
 				hlend = (((pix_available - pix_bardiff )*lhlend)/ltexth) + (pix_bardiff * (lhlend - st->top)/st->viewlines); 	
 			}





More information about the Bf-blender-cvs mailing list