[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19042] branches/blender2.5/blender/source /blender/editors: 2.5

Ton Roosendaal ton at blender.org
Thu Feb 19 18:13:07 CET 2009


Revision: 19042
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19042
Author:   ton
Date:     2009-02-19 18:13:04 +0100 (Thu, 19 Feb 2009)

Log Message:
-----------
2.5

Made sliders behave correct in SpaceGraph and SpaceAction.
- no slider draw when all is visible
- sliders update correct when visibility changes.

Still an issue here to tackle; view2d->tot is used incorrect...
it's set on window size now (??), it should be the boundbox of 
the entire contents. That allows correct slider draws and ops
like 'view home'.
Will poke Joshua tomorrow. :)

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/view2d.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
    branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2009-02-19 16:39:36 UTC (rev 19041)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2009-02-19 17:13:04 UTC (rev 19042)
@@ -731,10 +731,18 @@
 /* Change the size of the maximum viewable area (i.e. 'tot' rect) */
 void UI_view2d_totRect_set (View2D *v2d, int width, int height)
 {
+	int scroll= view2d_scroll_mapped(v2d->scroll);
+	
 	/* don't do anything if either value is 0 */
 	width= abs(width);
 	height= abs(height);
 	
+	/* hrumf! */
+	if(scroll & V2D_SCROLL_HORIZONTAL) 
+		width -= V2D_SCROLL_WIDTH;
+	if(scroll & V2D_SCROLL_VERTICAL) 
+		height -= V2D_SCROLL_HEIGHT;
+	
 	if (ELEM3(0, v2d, width, height)) {
 		printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d \n", v2d, width, height); // XXX temp debug info
 		return;

Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c	2009-02-19 16:39:36 UTC (rev 19041)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c	2009-02-19 17:13:04 UTC (rev 19042)
@@ -1037,12 +1037,10 @@
 	 *	  start of list offset, and the second is as a correction for the scrollers.
 	 */
 	height= ((items*ACHANNEL_STEP) + (ACHANNEL_HEIGHT*2));
-	if (height > (v2d->mask.ymax - v2d->mask.ymin)) {
-		/* don't use totrect set, as the width stays the same 
-		 * (NOTE: this is ok here, the configuration is pretty straightforward) 
-		 */
-		v2d->tot.ymin= (float)(-height);
-	}
+	/* don't use totrect set, as the width stays the same 
+	 * (NOTE: this is ok here, the configuration is pretty straightforward) 
+	 */
+	v2d->tot.ymin= (float)(-height);
 	
 	/* first backdrop strips */
 	y= (float)(-ACHANNEL_HEIGHT);

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c	2009-02-19 16:39:36 UTC (rev 19041)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c	2009-02-19 17:13:04 UTC (rev 19042)
@@ -786,7 +786,7 @@
 	}
 	
 	/* XXX I would call the below line! (ton) */
-	/* UI_view2d_totRect_set(v2d, ar->type->minsizex, height); */
+	UI_view2d_totRect_set(v2d, ar->winx, height);
 	
 	/* loop through channels, and set up drawing depending on their type  */	
 	y= (float)ACHANNEL_FIRST;

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c	2009-02-19 16:39:36 UTC (rev 19041)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c	2009-02-19 17:13:04 UTC (rev 19042)
@@ -482,7 +482,7 @@
 	/* regions: channels */
 	art= MEM_callocN(sizeof(ARegionType), "spacetype graphedit region");
 	art->regionid = RGN_TYPE_CHANNELS;
-	art->minsizex= 214; /* 200 is the 'standard', but due to scrollers, we want a bit more to fit the lock icons in */
+	art->minsizex= 200+V2D_SCROLL_WIDTH; /* 200 is the 'standard', but due to scrollers, we want a bit more to fit the lock icons in */
 	art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES;
 	art->listener= graph_region_listener;
 	art->init= graph_channel_area_init;





More information about the Bf-blender-cvs mailing list