[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48137] trunk/blender/source/blender/ editors: avoid calls to BLF_height_default in a loop calling with the same value, also quiet warning.

Campbell Barton ideasman42 at gmail.com
Wed Jun 20 21:23:13 CEST 2012


Revision: 48137
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48137
Author:   campbellbarton
Date:     2012-06-20 19:23:12 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
avoid calls to BLF_height_default in a loop calling with the same value, also quiet warning.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/view2d.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c

Modified: trunk/blender/source/blender/editors/interface/view2d.c
===================================================================
--- trunk/blender/source/blender/editors/interface/view2d.c	2012-06-20 18:46:18 UTC (rev 48136)
+++ trunk/blender/source/blender/editors/interface/view2d.c	2012-06-20 19:23:12 UTC (rev 48137)
@@ -2078,18 +2078,21 @@
 {
 	View2DString *v2s;
 	int col_pack_prev = 0;
+
+	/* investigate using BLF_ascender() */
+	const float default_height = strings.first ? BLF_height_default("28") : 0.0f;
 	
 	// glMatrixMode(GL_PROJECTION);
 	// glPushMatrix();
 	// glMatrixMode(GL_MODELVIEW);
 	// glPushMatrix();
 	ED_region_pixelspace(ar);
-	
+
 	for (v2s = strings.first; v2s; v2s = v2s->next) {
 		const char *str = (const char *)(v2s + 1);
 		int xofs = 0, yofs;
 
-		yofs = ceil(0.5f * (v2s->rect.ymax - v2s->rect.ymin - BLF_height_default("28")));
+		yofs = ceil(0.5f * (v2s->rect.ymax - v2s->rect.ymin - default_height));
 		if (yofs < 1) yofs = 1;
 
 		if (col_pack_prev != v2s->col.pack) {

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c	2012-06-20 18:46:18 UTC (rev 48136)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_ops.c	2012-06-20 19:23:12 UTC (rev 48137)
@@ -324,7 +324,6 @@
 void ED_operatormacros_sequencer(void)
 {
 	wmOperatorType *ot;
-	wmOperatorTypeMacro *otmacro;
 
 	ot = WM_operatortype_append_macro("SEQUENCER_OT_duplicate_move", "Duplicate Strips",
 	                                  "Duplicate selected strips and move them", OPTYPE_UNDO | OPTYPE_REGISTER);




More information about the Bf-blender-cvs mailing list