]> OCCT Git - occt-copy.git/commitdiff
0030537: Visualization - wrapping text in font text formatter
authornds <nds@opencascade.com>
Tue, 5 Mar 2019 16:57:36 +0000 (19:57 +0300)
committernds <nds@opencascade.com>
Tue, 5 Mar 2019 16:57:36 +0000 (19:57 +0300)
# last row length correction

src/Font/Font_TextFormatter.cxx

index bf10cb2b770c02b76eb5180e17e597b5d4af6439..7cbb083e19d94ffe0dd85874b994eda159ceec59 100644 (file)
@@ -428,7 +428,7 @@ Standard_ShortReal Font_TextFormatter::LineWidth (const Standard_Integer theInde
     return theIndex == 0 ? myNewLines[0] : myNewLines[theIndex] - myNewLines[theIndex -1];
 
   if (theIndex == myNewLines.Length()) // the last line
-    return myPen.x() - LineWidth (theIndex - 1);
+    return theIndex == 0 ? myPen.x() : myPen.x() - myNewLines[theIndex -1];
 
   return 0;
 }