[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17723] branches/blender2.5/blender/source /blender/editors: * seems like cur and tot were mixed up, thus preventing panning from working

Nathan Letwory jesterking at letwory.net
Fri Dec 5 19:41:28 CET 2008


Revision: 17723
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17723
Author:   jesterking
Date:     2008-12-05 19:41:28 +0100 (Fri, 05 Dec 2008)

Log Message:
-----------
* seems like cur and tot were mixed up, thus preventing panning from working

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/view2d.c
    branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2008-12-05 13:00:14 UTC (rev 17722)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2008-12-05 18:41:28 UTC (rev 17723)
@@ -118,7 +118,7 @@
 	
 	/* get pointers */
 	cur= &v2d->cur;
-	tot= &v2d->cur;
+	tot= &v2d->tot;
 	
 	/* dx, dy are width and height of v2d->cur, respectively */
 	dx= cur->xmax - cur->xmin;
@@ -344,39 +344,39 @@
 	/* handle width - posx and negx flags are mutually exclusive, so watch out */
 	if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
 		/* width is in negative-x half */
-		v2d->cur.xmin= (float)-width;
-		v2d->cur.xmax= 0.0f;
+		v2d->tot.xmin= (float)-width;
+		v2d->tot.xmax= 0.0f;
 	}
 	else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
 		/* width is in positive-x half */
-		v2d->cur.xmin= 0.0f;
-		v2d->cur.xmax= (float)width;
+		v2d->tot.xmin= 0.0f;
+		v2d->tot.xmax= (float)width;
 	}
 	else {
 		/* width is centered around x==0 */
 		const float dx= (float)width / 2.0f;
 		
-		v2d->cur.xmin= -dx;
-		v2d->cur.xmax= dx;
+		v2d->tot.xmin= -dx;
+		v2d->tot.xmax= dx;
 	}
 	
 	/* handle height - posx and negx flags are mutually exclusive, so watch out */
 	if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
 		/* height is in negative-y half */
-		v2d->cur.ymin= (float)-height;
-		v2d->cur.ymax= 0.0f;
+		v2d->tot.ymin= (float)-height;
+		v2d->tot.ymax= 0.0f;
 	}
 	else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
 		/* height is in positive-y half */
-		v2d->cur.ymin= 0.0f;
-		v2d->cur.ymax= (float)height;
+		v2d->tot.ymin= 0.0f;
+		v2d->tot.ymax= (float)height;
 	}
 	else {
 		/* height is centered around y==0 */
 		const float dy= (float)height / 2.0f;
 		
-		v2d->cur.ymin= -dy;
-		v2d->cur.ymax= dy;
+		v2d->tot.ymin= -dy;
+		v2d->tot.ymax= dy;
 	}
 }
 
@@ -742,14 +742,14 @@
 	/* horizontal scrollers */
 	if (v2d->scroll & (V2D_SCROLL_HORIZONTAL|V2D_SCROLL_HORIZONTAL_O)) {
 		/* slider 'button' extents */
-		totsize= v2d->cur.xmax - v2d->cur.xmin;
+		totsize= v2d->tot.xmax - v2d->tot.xmin;
 		scrollsize= hor.xmax - hor.xmin;
 		
-		fac= (v2d->cur.xmin- v2d->cur.xmin) / totsize;
+		fac= (v2d->cur.xmin- v2d->tot.xmin) / totsize;
 		//if (fac < 0.0f) fac= 0.0f;
 		scrollers->hor_min= hor.xmin + (fac * scrollsize);
 		
-		fac= (v2d->cur.xmax - v2d->cur.xmin) / totsize;
+		fac= (v2d->cur.xmax - v2d->tot.xmin) / totsize;
 		//if (fac > 1.0f) fac= 1.0f;
 		scrollers->hor_max= hor.xmin + (fac * scrollsize);
 		
@@ -760,14 +760,14 @@
 	/* vertical scrollers */
 	if (v2d->scroll & V2D_SCROLL_VERTICAL) {
 		/* slider 'button' extents */
-		totsize= v2d->cur.ymax - v2d->cur.ymin;
+		totsize= v2d->tot.ymax - v2d->tot.ymin;
 		scrollsize= vert.ymax - vert.ymin;
 		
-		fac= (v2d->cur.ymin- v2d->cur.ymin) / totsize;
+		fac= (v2d->cur.ymin- v2d->tot.ymin) / totsize;
 		//if (fac < 0.0f) fac= 0.0f;
 		scrollers->vert_min= vert.ymin + (fac * scrollsize);
 		
-		fac= (v2d->cur.ymax - v2d->cur.ymin) / totsize;
+		fac= (v2d->cur.ymax - v2d->tot.ymin) / totsize;
 		//if (fac > 1.0f) fac= 1.0f;
 		scrollers->vert_max= vert.ymin + (fac * scrollsize);
 		

Modified: branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c	2008-12-05 13:00:14 UTC (rev 17722)
+++ branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c	2008-12-05 18:41:28 UTC (rev 17723)
@@ -393,7 +393,7 @@
 
 	if ((rows*ROW_HEIGHT) > height)
 		height= rows * ROW_HEIGHT;
-	width= (cols + 1) * COLUMN_WIDTH;
+	width= cols * COLUMN_WIDTH;
 	
 	/* need to validate view2d after updating size of tot */
 	UI_view2d_totRect_set(v2d, width, height);





More information about the Bf-blender-cvs mailing list