[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60030] trunk/blender: take the decender into account when drawing console text.

Campbell Barton ideasman42 at gmail.com
Wed Sep 11 06:14:28 CEST 2013


Revision: 60030
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60030
Author:   campbellbarton
Date:     2013-09-11 04:14:27 +0000 (Wed, 11 Sep 2013)
Log Message:
-----------
take the decender into account when drawing console text.
also add data types wm and mask to dataname() and unshadow var in ghost/x11

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/space_info/textview.c

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-09-11 02:36:37 UTC (rev 60029)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-09-11 04:14:27 UTC (rev 60030)
@@ -182,7 +182,6 @@
 	 * X can find us a visual matching those requirements. */
 
 	int attributes[40], i, samples;
-	Atom atoms[2];
 	int natom;
 	int glxVersionMajor, glxVersionMinor; /* As in GLX major.minor */
 
@@ -405,6 +404,7 @@
 
 	/* The basic for a good ICCCM "work" */
 	if (m_system->m_atom.WM_PROTOCOLS) {
+		Atom atoms[2];
 		natom = 0;
 
 		if (m_system->m_atom.WM_DELETE_WINDOW) {

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2013-09-11 02:36:37 UTC (rev 60029)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2013-09-11 04:14:27 UTC (rev 60030)
@@ -7066,7 +7066,9 @@
 		case ID_BR: return "Data from BR";
 		case ID_PA: return "Data from PA";
 		case ID_GD: return "Data from GD";
+		case ID_WM: return "Data from WM";
 		case ID_MC: return "Data from MC";
+		case ID_MSK: return "Data from MSK";
 		case ID_LS: return "Data from LS";
 	}
 	return "Data from Lib Block";

Modified: trunk/blender/source/blender/editors/space_info/textview.c
===================================================================
--- trunk/blender/source/blender/editors/space_info/textview.c	2013-09-11 02:36:37 UTC (rev 60029)
+++ trunk/blender/source/blender/editors/space_info/textview.c	2013-09-11 04:14:27 UTC (rev 60030)
@@ -57,6 +57,7 @@
 typedef struct ConsoleDrawContext {
 	int cwidth;
 	int lheight;
+	int lofs; /* text vertical offset */
 	int console_width; /* number of characters that fit into the width of the console (fixed width) */
 	int winx;
 	int ymin, ymax;
@@ -192,7 +193,7 @@
 		glColor3ubv(fg);
 
 		/* last part needs no clipping */
-		BLF_position(mono, cdc->xy[0], cdc->xy[1], 0);
+		BLF_position(mono, cdc->xy[0], cdc->lofs + cdc->xy[1], 0);
 		BLF_draw_mono(mono, s, len, cdc->cwidth);
 
 		if (cdc->sel[0] != cdc->sel[1]) {
@@ -208,7 +209,7 @@
 			len = offsets[i] - offsets[i - 1];
 			s = str + offsets[i - 1];
 
-			BLF_position(mono, cdc->xy[0], cdc->xy[1], 0);
+			BLF_position(mono, cdc->xy[0], cdc->lofs + cdc->xy[1], 0);
 			BLF_draw_mono(mono, s, len, cdc->cwidth);
 			
 			if (cdc->sel[0] != cdc->sel[1]) {
@@ -239,7 +240,7 @@
 
 		glColor3ubv(fg);
 
-		BLF_position(mono, cdc->xy[0], cdc->xy[1], 0);
+		BLF_position(mono, cdc->xy[0], cdc->lofs + cdc->xy[1], 0);
 		BLF_draw_mono(mono, str, str_len, cdc->cwidth);
 		
 		if (cdc->sel[0] != cdc->sel[1]) {
@@ -291,6 +292,7 @@
 	cdc.cwidth = (int)BLF_fixed_width(mono);
 	assert(cdc.cwidth > 0);
 	cdc.lheight = tvc->lheight;
+	cdc.lofs = -BLF_descender(mono);
 	/* note, scroll bar must be already subtracted () */
 	cdc.console_width = (tvc->winx - (CONSOLE_DRAW_MARGIN * 2) ) / cdc.cwidth;
 	CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */




More information about the Bf-blender-cvs mailing list