From: Kirill Gavrilov Date: Sat, 2 Mar 2024 12:03:11 +0000 (+0300) Subject: Draw - Fix message color mixing (#685) X-Git-Tag: V7_9_2~8 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c832b192b573bbbbe1fbdc8d3401fecfa76a8ea9;p=occt.git Draw - Fix message color mixing (#685) Message color from previous message in Unix was mixed. --- diff --git a/src/Draw/Draw.cxx b/src/Draw/Draw.cxx index 32160fa707..e988694f2f 100644 --- a/src/Draw/Draw.cxx +++ b/src/Draw/Draw.cxx @@ -645,11 +645,12 @@ Standard_Boolean Draw_Interprete(const char* com) { Message_PrinterOStream::SetConsoleTextColor(&std::cout, Message_ConsoleColor_Red, true); } - std::cout << theCommands.Result() << std::endl; + std::cout << theCommands.Result(); if (c > 0 && theCommands.ToColorize()) { Message_PrinterOStream::SetConsoleTextColor(&std::cout, Message_ConsoleColor_Default, false); } + std::cout << std::endl; } if (Draw_Chrono && hadchrono) diff --git a/src/Draw/Draw_BasicCommands.cxx b/src/Draw/Draw_BasicCommands.cxx index 1dafbc839f..9bbe546607 100644 --- a/src/Draw/Draw_BasicCommands.cxx +++ b/src/Draw/Draw_BasicCommands.cxx @@ -1250,17 +1250,15 @@ static int dputs(Draw_Interpretor& theDI, Standard_Integer theArgNb, const char* { Message_PrinterOStream::SetConsoleTextColor(aStream, aColor, toIntense); } - *aStream << theArgVec[anArgIter]; - if (!isNoNewline) - { - *aStream << std::endl; - } - if (toIntense || aColor != Message_ConsoleColor_Default) { Message_PrinterOStream::SetConsoleTextColor(aStream, Message_ConsoleColor_Default, false); } + if (!isNoNewline) + { + *aStream << std::endl; + } return 0; } else