From 9608effaa0f43fa68e9339892a4383779eb5f7ea Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Sun, 14 May 2017 17:19:21 +0800 Subject: [PATCH] Fix Views Bug in ColorPage --- ColorUI.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ColorUI.cpp b/ColorUI.cpp index eb2e9b5..1a99efd 100644 --- a/ColorUI.cpp +++ b/ColorUI.cpp @@ -100,12 +100,15 @@ inline int _ConsoleColor2winBackColor(ConsoleColor conColor) } } -inline void cprint(ConsoleColor FrontColor,ConsoleColor BackColor) +inline void cprint(ConsoleColor FrontColor,ConsoleColor BackColor,bool withIntensity=true) { int iFront=_ConsoleColor2winForeColor(FrontColor); int iBack=_ConsoleColor2winBackColor(BackColor); - if(iFront!=0) iFront=iFront | FOREGROUND_INTENSITY; - if(iBack!=0) iBack=iBack| BACKGROUND_INTENSITY; + if(withIntensity) + { + if(iFront!=0) iFront=iFront | FOREGROUND_INTENSITY; + if(iBack!=0) iBack=iBack| BACKGROUND_INTENSITY; + } SetConsoleTextAttribute(_auto_init_console_info_obj.hout,iFront | iBack ); } @@ -391,7 +394,7 @@ void ColorPage::draw() } if(!text.empty()) { - _cns::cprint(textFrontColor,textBackColor); + _cns::cprint(textFrontColor,textBackColor,false); printf("%s\n",text.c_str()); } if(!_curActive) // _curActive==0