[ekg2-commit] r4115 - trunk/plugins/ncurses: trunk/plugins/ncurses/old.c

SVN commit svn w toxygen.net
Śro, 16 Lip 2008, 14:51:15 CEST


Author: darkjames
Date: 2008-07-16 14:51:15 +0200 (Wed, 16 Jul 2008)
New Revision: 4115

Modified:
   trunk/plugins/ncurses/old.c
Log:
- fix display_color == 2.


Modified: trunk/plugins/ncurses/old.c
===================================================================
--- trunk/plugins/ncurses/old.c	2008-07-16 12:39:32 UTC (rev 4114)
+++ trunk/plugins/ncurses/old.c	2008-07-16 12:51:15 UTC (rev 4115)
@@ -1336,10 +1336,10 @@
 /* 13 wrz 06 	removed status cause it was always 1 (dj)  */
 		
 static int window_printat(WINDOW *w, int x, int y, const char *format, struct format_data *data, int fgcolor, int bold, int bgcolor) {
-	int orig_x = x;
 	int backup_display_color = config_display_color;
 	char *ftext = NULL;		/* tekst do zwolnienia jesli !config_display_pl_chars */
 	const char *p;			/* parsowanie format lub ftext jesli !config_display_pl_chars */
+	int orig_x = x;
 
 	if (!w)
 		return -1;
@@ -1350,8 +1350,13 @@
 		p = ftext;
 	} else	p = format;
 
-	if (config_display_color == 2)	config_display_color = 0;
+	if (orig_x == 0) {
+		if (config_display_color == 2) 
+			config_display_color = 0;
 
+		wattrset(w, color_pair(fgcolor, bgcolor));
+	}
+
 	wmove(w, y, x);
 			
 	while (*p && *p != '}' && x <= w->_maxx) {
@@ -1555,10 +1560,10 @@
 
 		for (i = x; i <= w->_maxx; i++)
 			waddch(w, ' ');
+
+		config_display_color = backup_display_color;
 	}
 
-	config_display_color = backup_display_color;
-
 	if (ftext) xfree(ftext);
 	return x - orig_x;
 }



Więcej informacji o liście dyskusyjnej ekg2-commit