Fixed: Coordinates weren't drawn properly on a bright background (was always drawn in bright colors..). Note that previous commits were left dangling in their own head, the string class changes broke too many things.

2013-05-27

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Mon, 27 May 2013 13:49:07 +0300 (2013-05-27)
changeset 260
a3bab31c7e27
parent 259
69a842af73f7
child 261
c4ad4e3c6839

Fixed: Coordinates weren't drawn properly on a bright background (was always drawn in bright colors..). Note that previous commits were left dangling in their own head, the string class changes broke too many things.

src/gldraw.cpp file | annotate | diff | comparison | revisions
--- a/src/gldraw.cpp	Sat May 25 02:15:25 2013 +0300
+++ b/src/gldraw.cpp	Mon May 27 13:49:07 2013 +0300
@@ -490,7 +490,7 @@
 	if (drawOnly ())
 		return;
 	
-	if (m_camera != Free) {
+	if (m_camera != Free && !picking ()) {
 		// Paint the overlay image if we have one
 		const overlayMeta& overlay = m_overlays[m_camera];
 		if (overlay.img != null) {
@@ -506,13 +506,13 @@
 		m_hoverpos = coordconv2_3 (m_pos, true);
 		
 		// Paint the coordinates onto the screen.
-		str text;
-		text.format ("X: %s, Y: %s, Z: %s", ftoa (m_hoverpos[X]).chars (),
+		str text = fmt ("X: %s, Y: %s, Z: %s", ftoa (m_hoverpos[X]).chars (),
 			ftoa (m_hoverpos[Y]).chars (), ftoa (m_hoverpos[Z]).chars ());
 		
 		QFontMetrics metrics = QFontMetrics (font ());
 		QRect textSize = metrics.boundingRect (0, 0, m_width, m_height, Qt::AlignCenter, text);
 		
+		paint.setPen (m_darkbg ? Qt::white : Qt::black);
 		paint.drawText (m_width - textSize.width (), m_height - 16, textSize.width (),
 			textSize.height (), Qt::AlignCenter, text);
 		

mercurial