From: nds Date: Tue, 5 Mar 2019 16:57:36 +0000 (+0300) Subject: 0030537: Visualization - wrapping text in font text formatter X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=7dab09204f899fc54dbd5379bcd76e7d23af831d;p=occt-copy.git 0030537: Visualization - wrapping text in font text formatter # last row length correction --- diff --git a/src/Font/Font_TextFormatter.cxx b/src/Font/Font_TextFormatter.cxx index bf10cb2b77..7cbb083e19 100644 --- a/src/Font/Font_TextFormatter.cxx +++ b/src/Font/Font_TextFormatter.cxx @@ -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; }