Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

QWMatrix Component::transMatrix ( int  angleDegrees,
bool  flipped,
int  x,
int  y,
bool  inverse = false 
) [static, inherited]

Returns the translation matrix used for painting et al

Parameters:
orientation The orientation to use
x x co-ordinate of the center of the object to be mapped
y y co-ordinate of the center of the object to be mapped
inverse If false, maps the unrotated item to a rotated one, else mapped->unmapped

Definition at line 243 of file component.cpp.

Referenced by ItemLibrary::itemImage(), and Component::itemPointsChanged().

{
      QWMatrix m;
      m.translate( x, y );
      if (inverse)
      {
            m.rotate(-angleDegrees);
            if (flipped)
                  m.scale( -1, 1 );
      }
      else
      {
            if (flipped)
                  m.scale( -1, 1 );
            m.rotate(angleDegrees);
      }
      m.translate( -x, -y );
      m.setTransformationMode( QWMatrix::Areas );
      return m;
}


Generated by  Doxygen 1.6.0   Back to index