From 783914e968375a3165dffc83ae66c285a8c8dcbc Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 5 Mar 2019 18:54:28 +0300 Subject: [PATCH] 0030537: Visualization - wrapping text in font text formatter #corners should be arranged around (0,0) point, example of the first point if rect width is 100, symbol has an empty width: # - left alignment: (-50, 0) # - center alignment: (0, 0) # - right alignment: (50, 0) --- src/Font/Font_TextFormatter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Font/Font_TextFormatter.cxx b/src/Font/Font_TextFormatter.cxx index 350517aae1..bf10cb2b77 100644 --- a/src/Font/Font_TextFormatter.cxx +++ b/src/Font/Font_TextFormatter.cxx @@ -194,7 +194,7 @@ void Font_TextFormatter::newLine (const Standard_Integer theLastRect, default: case Graphic3d_HTA_LEFT: myMoveVec.x() = -aXMin; break; case Graphic3d_HTA_RIGHT: myMoveVec.x() = -aXMin + (theMaxLineWidth - (aXMax - aXMin)) - theMaxLineWidth; break; - case Graphic3d_HTA_CENTER: myMoveVec.x() = -aXMin + 0.5f * (theMaxLineWidth - (aXMax - aXMin)) - 0.5 * theMaxLineWidth; break; + case Graphic3d_HTA_CENTER: myMoveVec.x() = -aXMin + 0.5f * (theMaxLineWidth - (aXMax - aXMin)) - 0.5f * theMaxLineWidth; break; } move (myCorners, myMoveVec, myRectLineStart, theLastRect); -- 2.39.5