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

bool wxPdfDocument::Scale ( double  sx,
double  sy,
double  x = -1,
double  y = -1 
) [virtual]

Performs scaling in X and Y direction.

A scaling transformation is applied independently for X and Y direction.

Parameters:
sx,:scaling factor for width in percent. 0 is not allowed.
sy,:scaling factor for height in percent. 0 is not allowed.
x,:abscissa of the scaling center. Default is current x position
y,:ordinate of the scaling center. Default is current y position

Definition at line 1669 of file pdfgraphics.cpp.

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

Referenced by MirrorH(), MirrorV(), ScaleX(), ScaleXY(), and ScaleY().

{
  if (x < 0)
  {
    x = m_x;
  }
  if (y < 0)
  {
    y = m_y;
  }
  if (sx == 0 || sy == 0)
  {
    wxLogError(_T("wxPdfDocument::Scale: Please use values unequal to zero for Scaling."));
    return false;
  }
  y = (m_h - y) * m_k;
  x *= m_k;
  //calculate elements of transformation matrix
  sx /= 100;
  sy /= 100;
  double tm[6];
  tm[0] = sx;
  tm[1] = 0;
  tm[2] = 0;
  tm[3] = sy;
  tm[4] = x * (1 - sx);
  tm[5] = y * (1 - sy);
  //scale 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