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

bool wxPdfDocument::Skew ( double  xAngle,
double  yAngle,
double  x = -1,
double  y = -1 
) [virtual]

Performs a skewing in both X and Y directions.

Parameters:
xAngle,:angle in degrees between -90 (skew to the left) and 90 (skew to the right)
yAngle,:angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
x,:abscissa of the skewing center. default is current x position
y,:ordinate of the skewing center. default is current y position

Definition at line 1791 of file pdfgraphics.cpp.

References m_h, m_inTransform, m_k, m_x, m_y, StartTransform(), and Transform().

Referenced by SkewX(), and SkewY().

{
  if (x < 0)
  {
    x = m_x;
  }
  if (y < 0)
  {
    y = m_y;
  }
  if (xAngle <= -90 || xAngle >= 90 || yAngle <= -90 || yAngle >= 90)
  {
    wxLogError(_T("wxPdfDocument::Skew: Please use values between -90 and 90 degree for skewing."));
    return false;
  }
  x *= m_k;
  y = (m_h - y) * m_k;
  //calculate elements of transformation matrix
  double tm[6];
  xAngle *= (atan(1.) / 45.);
  yAngle *= (atan(1.) / 45.);
  tm[0] = 1;
  tm[1] = tan(yAngle);
  tm[2] = tan(xAngle);
  tm[3] = 1;
  tm[4] = -tm[2] * y;
  tm[5] = -tm[1] * x;
  //skew the coordinate system
  if (m_inTransform == 0)
  {
    StartTransform();
  }
  Transform(tm);
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index