0025180: Visualization - Homogeneous transformation API in TKV3d
[occt.git] / src / AIS / AIS_TextLabel.cxx
index 6033cc0..5ba7e37 100644 (file)
@@ -261,7 +261,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
                           anAsp->Aspect()->GetTextFontAspect(), (unsigned int)anAsp->Height(), aResolution))
           {
             isInit = Standard_True;
-            const NCollection_String aText ((Standard_Utf16Char* )myText.ToExtString());
+            const NCollection_String aText (myText.ToExtString());
             Font_Rect aBndBox = aFont.BoundingBox (aText, anAsp->HorizontalJustification(), anAsp->VerticalJustification());
             Standard_Real aWidth = Abs (aBndBox.Width());
             Standard_Real aHeight = Abs (aBndBox.Height());
@@ -284,10 +284,12 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
               aCenterOfLabel.ChangeCoord() -= myOrientation3D.XDirection().XYZ() * aWidth * 0.5;
             }
 
-            if (!anAsp->Aspect()->GetTextZoomable())
+            if (!anAsp->Aspect()->GetTextZoomable()
+             && (TransformPersistence().IsNull()
+              || TransformPersistence()->Mode() == Graphic3d_TMF_ZoomPers))
             {
               anAsp->Aspect()->SetTextZoomable (Standard_True);
-              SetTransformPersistence (GetTransformPersistenceMode() | Graphic3d_TMF_ZoomPers, aPosition);
+              SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_ZoomPers, aPosition));
               aPosition = gp::Origin();
             }