]> granicus.if.org Git - nethack/commitdiff
Win32GUI: Fix bug with specifying no color for status hilite.
authorBart House <bart@barthouse.com>
Mon, 9 Oct 2017 00:33:20 +0000 (17:33 -0700)
committerPasi Kallinen <paxed@alt.org>
Mon, 9 Oct 2017 11:57:34 +0000 (14:57 +0300)
We were mapping NO_COLOR to white instead of the default foreground color.

win/win32/mhstatus.c

index 5e522b7b14986a0243d089f36d304dd047bba3f2..fe1badb48ceefed8ebf6308e0e49b107d81659c3 100644 (file)
@@ -275,7 +275,8 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
             else if (atr & HL_DIM)
                 fntatr = ATR_DIM;
             fnt = mswin_get_font(NHW_STATUS, fntatr, hdc, FALSE);
-            nFg = (clr >= 0 && clr < CLR_MAX) ? nhcolor_to_RGB(clr) : Fg;
+            nFg = (clr == NO_COLOR ? Fg :
+                   ((clr >= 0 && clr < CLR_MAX) ? nhcolor_to_RGB(clr) : Fg));
             nBg = Bg;
 
             GetTextExtentPoint32(hdc, wbuf, vlen, &sz);