[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57453] trunk/blender/source/blender: Fix for

Jeroen Bakker j.bakker at atmind.nl
Fri Jun 14 15:56:01 CEST 2013


Revision: 57453
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57453
Author:   jbakker
Date:     2013-06-14 13:56:00 +0000 (Fri, 14 Jun 2013)
Log Message:
-----------
Fix for 
 * [#35724] Backdrop zoom can be set to a very small value, making the backdrop disapear.

There were checks in the drawnode that needed to be placed in the readfile.
The checks checked if the zoomlevel was 0.0, then it was defaulted to 1.0, but the zoomvalue had a minimum limit of 0.01, hence it did not work.
Moved the check to the readfile and checked for all values smaller then 0.02. These values are then reset to 1.0

Jeroen & Monique
 - At Mind -

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/space_node/drawnode.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2013-06-14 09:59:09 UTC (rev 57452)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2013-06-14 13:56:00 UTC (rev 57453)
@@ -9476,6 +9476,7 @@
 
 
 	{
+		bScreen *sc;
 		Object *ob;
 
 		for (ob = main->object.first; ob; ob = ob->id.next) {
@@ -9491,6 +9492,28 @@
 				}
 			}
 		}
+
+		/*
+		 * FIX some files have a zoom level of 0, and was checked during the drawing of the node space
+		 *
+		 * We moved this check to the do versions to be sure the value makes any sense.
+		 */
+		for (sc = main->screen.first; sc; sc = sc->id.next) {
+			ScrArea *sa;
+			for (sa = sc->areabase.first; sa; sa = sa->next) {
+				SpaceLink *sl;
+				for (sl = sa->spacedata.first; sl; sl = sl->next) {
+					if (sl->spacetype == SPACE_NODE)
+					{
+						SpaceNode *snode = (SpaceNode *)sl;
+						if (snode->zoom < 0.02)
+						{
+							snode->zoom = 1.0;
+						}
+					}
+				}
+			}
+		}
 	}
 
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2013-06-14 09:59:09 UTC (rev 57452)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2013-06-14 13:56:00 UTC (rev 57453)
@@ -2021,9 +2021,6 @@
 	float y1, y2, y3, y4;
 
 
-	/* keep this, saves us from a version patch */
-	if (snode->zoom == 0.0f) snode->zoom = 1.0f;
-
 	glColor3f(1.0, 1.0, 1.0);
 
 	cx  = x + snode->zoom * backdropWidth * boxmask->x;
@@ -2062,9 +2059,6 @@
 	float y1, y2, y3, y4;
 
 
-	/* keep this, saves us from a version patch */
-	if (snode->zoom == 0.0f) snode->zoom = 1.0f;
-
 	glColor3f(1.0, 1.0, 1.0);
 
 	cx  = x + snode->zoom * backdropWidth * ellipsemask->x;
@@ -2886,9 +2880,6 @@
 		glMatrixMode(GL_MODELVIEW);
 		glPushMatrix();
 		
-		/* keep this, saves us from a version patch */
-		if (snode->zoom == 0.0f) snode->zoom = 1.0f;
-		
 		/* somehow the offset has to be calculated inverse */
 		
 		glaDefine2DArea(&ar->winrct);




More information about the Bf-blender-cvs mailing list