inline void Prs2d_Length::CalcTxtPos(const Standard_Boolean theFromAbs) { if (!theFromAbs) { gp_Pnt2d thePnt1(myX1,myY1), thePnt2(myX2,myY2),theOrigine,theTmp; if ( (myX1==myX2 && myY1>myY2 ) || (myX1>myX2) ) { theTmp = thePnt1; thePnt1 = thePnt2; thePnt2 = theTmp; } gp_Vec2d VX( 1., 0. ), theVecI,theVecJ,theVec(thePnt1,thePnt2),tmpVec; Standard_Real coeff=21.5/12;// this coefficient from font symbol size Standard_Real theTextLen=myText.Length()*myTextScale*coeff; Standard_Real theDist=thePnt1.Distance(thePnt2); theVec.Normalize(); theVecI = theVec*(theDist/2-theTextLen/2+myTextPosH); tmpVec = theVec*(theDist/2+myTextPosH); theVecJ = theVec.Rotated(PI/2)*myTextPosV; theOrigine=thePnt1; theOrigine.Translate(tmpVec); theOrigine.Translate(theVecJ); theVec.Rotate(myTextAngle); thePnt1.Translate(theVecI); thePnt1.Translate(theVecJ); thePnt1.Rotate(theOrigine, myTextAngle); Standard_Real theTxtAngle = VX.Angle( theVec ); gp_Pnt2d pntText=thePnt1; myAbsAngle=theTxtAngle; myAbsX=pntText.X(); myAbsY=pntText.Y(); } }