]> OCCT Git - occt.git/commitdiff
Draw - Fix message color mixing (#685)
authorKirill Gavrilov <kirill@sview.ru>
Sat, 2 Mar 2024 12:03:11 +0000 (15:03 +0300)
committerdpasukhi <dpasukhi@opencascade.com>
Sat, 6 Sep 2025 20:18:29 +0000 (21:18 +0100)
Message color from previous message in Unix was mixed.

src/Draw/Draw.cxx
src/Draw/Draw_BasicCommands.cxx

index 32160fa7076dab314bf991515740a800d91981da..e988694f2f42103243f40f82b29128fbfc051afb 100644 (file)
@@ -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)
index 1dafbc839f0e174cba974283cf488c9455612895..9bbe546607a3d960e98163f446854dfa06094f95 100644 (file)
@@ -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