]> OCCT Git - occt-copy.git/commitdiff
Wrapping functionality in Font_TextFormatter - using direct size of lines container
authornds <nds@opencascade.com>
Tue, 5 Mar 2019 10:52:37 +0000 (13:52 +0300)
committernds <nds@opencascade.com>
Tue, 5 Mar 2019 10:52:37 +0000 (13:52 +0300)
src/Font/Font_TextFormatter.cxx

index 5db02b09ea2bd4e8fe0898bde38b4372f614bc44..108b93fc7e4f735da33c023405b90743e9a04d04 100644 (file)
@@ -237,8 +237,9 @@ void Font_TextFormatter::Format()
       aMaxLineWidth = myPen.x();
     else
     {
-      for (int aLineIt = 0; aLineIt < myLinesNb; aLineIt++)
+      for (int aLineIt = 0; aLineIt < myNewLines.Size(); aLineIt++)
         aMaxLineWidth = Max (aMaxLineWidth, LineWidth (aLineIt));
+      aMaxLineWidth = Max (aMaxLineWidth, LineWidth (myNewLines.Size())); // processing the last line also
     }
   }