[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26961] branches/blender2.4/source/blender : bugfix in 2.4x also [#20480] crash/lock-up for certain aspect ratios

Campbell Barton ideasman42 at gmail.com
Tue Feb 16 17:04:38 CET 2010


Revision: 26961
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26961
Author:   campbellbarton
Date:     2010-02-16 17:04:38 +0100 (Tue, 16 Feb 2010)

Log Message:
-----------
bugfix in 2.4x also [#20480] crash/lock-up for certain aspect ratios

Modified Paths:
--------------
    branches/blender2.4/source/blender/blenlib/BLI_blenlib.h
    branches/blender2.4/source/blender/blenlib/intern/rct.c
    branches/blender2.4/source/blender/src/drawnode.c

Modified: branches/blender2.4/source/blender/blenlib/BLI_blenlib.h
===================================================================
--- branches/blender2.4/source/blender/blenlib/BLI_blenlib.h	2010-02-16 15:59:36 UTC (rev 26960)
+++ branches/blender2.4/source/blender/blenlib/BLI_blenlib.h	2010-02-16 16:04:38 UTC (rev 26961)
@@ -326,6 +326,7 @@
  * @return True if @a rect is empty.
  */
 int  BLI_rcti_is_empty(struct rcti *rect);
+int  BLI_rctf_is_empty(struct rctf *rect);
 void BLI_init_rctf(struct rctf *rect, float xmin, float xmax, float ymin, float ymax);
 void BLI_init_rcti(struct rcti *rect, int xmin, int xmax, int ymin, int ymax);
 void BLI_translate_rctf(struct rctf *rect, float x, float y);

Modified: branches/blender2.4/source/blender/blenlib/intern/rct.c
===================================================================
--- branches/blender2.4/source/blender/blenlib/intern/rct.c	2010-02-16 15:59:36 UTC (rev 26960)
+++ branches/blender2.4/source/blender/blenlib/intern/rct.c	2010-02-16 16:04:38 UTC (rev 26961)
@@ -48,6 +48,12 @@
 			(rect->ymax<=rect->ymin));
 }
 
+int BLI_rctf_is_empty(rctf * rect)
+{
+	return ((rect->xmax<=rect->xmin) ||
+			(rect->ymax<=rect->ymin));
+}
+
 int BLI_in_rcti(rcti * rect, int x, int y)
 {
 

Modified: branches/blender2.4/source/blender/src/drawnode.c
===================================================================
--- branches/blender2.4/source/blender/src/drawnode.c	2010-02-16 15:59:36 UTC (rev 26960)
+++ branches/blender2.4/source/blender/src/drawnode.c	2010-02-16 16:04:38 UTC (rev 26961)
@@ -3365,7 +3365,7 @@
 	
 	/* preview */
 	if(node->flag & NODE_PREVIEW)
-		if(node->preview && node->preview->rect)
+		if(node->preview && node->preview->rect && !BLI_rctf_is_empty(&node->prvr))
 			node_draw_preview(node->preview, &node->prvr);
 		
 	/* buttons */





More information about the Bf-blender-cvs mailing list