Changeset 1851 in Sophya for trunk/SophyaPI/PI/pigraphps.cc


Ignore:
Timestamp:
Jan 11, 2002, 7:53:14 PM (24 years ago)
Author:
ansari
Message:
  • Fin (?) d'amelioration de la fidelite de trace de chaine de caracteres

ds psfile.cc + positionnement de trace de chaine (vertical-Horizontal)

  • Ajout d'attribut de nom ds PIDrawer + Amelioration de PIDrawerTools
  • Amelioration du programme de test de trace de chaine (Tests/pist.cc)

Reza 11/01/2002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pigraphps.cc

    r1848 r1851  
    114114void PIGraphicPS::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
    115115{
    116 if(mPSOut)
    117   //  mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */
    118   mPSOut->DrawString((double)x,(double)y,s,mFCol, myFont.GetFontName(),
    119                      myFont.GetFontAtt(),  myFont.GetFontSize(),
    120                      pos); /* $CHECK$  x 0.9 - Reza 4/11/99  - enleve 3/01/2002 */
    121 // Calculez la taille de la boite occupe par la fonte
    122 //  myFont.GetFontHeight(int& asc, int& desc)  Tres proche de myFont.GetFontSize() en principe
    123 //  myFont.GetStringWidth(char const* s)  Largeur occupe par la chaine
     116if(mPSOut) {
     117  int posh = pos & PI_HorizontalPosition;
     118  int posv = pos & PI_VerticalPosition;
     119  int dx,dy;
     120  double xd = x;
     121  double yd = y;
     122  if ( CalcStringPositionShift(s, posv, dx, dy) ) yd -= dy;
     123  mPSOut->DrawString(xd, yd, s, mFCol, myFont.GetFontName(), myFont.GetFontAtt(),
     124                     myFont.GetFontSize(), posh);
     125}
    124126return;
    125127}
     
    128130void PIGraphicPS::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
    129131{
    130 if(mPSOut)
    131   //  mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */
    132   mPSOut->DrawString((double)x,(double)y,s,mFCol, myFont.GetFontName(),
    133                      myFont.GetFontAtt(),  myFont.GetFontSize(),
    134                      pos);  /* $CHECK$  x 0.9 - Reza 4/11/99 */
    135 // Idem taille ici
     132if(mPSOut) {
     133  int posh = pos & PI_HorizontalPosition;
     134  int posv = pos & PI_VerticalPosition;
     135  int dx,dy;
     136  double xd = x;
     137  double yd = y;
     138  if ( CalcStringPositionShift(s, posv, dx, dy) ) yd -= dy;
     139  mPSOut->DrawString(xd, yd, s, mFCol, myFont.GetFontName(), myFont.GetFontAtt(),
     140                     myFont.GetFontSize(), posh);
     141}
    136142return;
    137143}
Note: See TracChangeset for help on using the changeset viewer.