]> 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>
Sun, 24 Aug 2025 17:00:48 +0000 (18:00 +0100)
Message color from previous message in Unix was mixed.

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

index 6528b65f83de5c0940eb0ab4c46d0963725e73dd..f9e6640105a48731d46bdd648bbadda35d07fae1 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 a34a144f83d9ecebc3bac983b91ef332b1b2bcc1..ed583e87c9d8b4b81261aef9436cac56577dda76 100644 (file)
@@ -1254,17 +1254,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