]> OCCT Git - occt-copy.git/commitdiff
0030537: Visualization - wrapping text in font text formatter
authornds <nds@opencascade.com>
Tue, 5 Mar 2019 15:54:28 +0000 (18:54 +0300)
committernds <nds@opencascade.com>
Tue, 5 Mar 2019 15:54:28 +0000 (18:54 +0300)
#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

index 350517aae1ef3a7a405db83c9f3a2a9c9ac4bd08..bf10cb2b770c02b76eb5180e17e597b5d4af6439 100644 (file)
@@ -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);