home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / auto / Tk / Ghostscript / ChangeView.al < prev    next >
Encoding:
Text File  |  1997-08-10  |  524 b   |  22 lines

  1. # NOTE: Derived from ..\blib\lib\Tk\Ghostscript.pm.  Changes made here will be lost.
  2. package Tk::Ghostscript;
  3.  
  4. sub ChangeView
  5. {
  6.  my $w = shift;
  7.  my ($llx,$lly,$urx,$ury) = @{$w->{'BoundingBox'}};
  8.  my $x = int(($urx - $llx)*$w->{'x_pixels_per_inch'}/72.0);
  9.  my $y = int(($ury - $lly)*$w->{'y_pixels_per_inch'}/72.0);
  10.  $w->StopInterp;
  11.  if ($w->{'page_orientation'} % 180 == 0)
  12.   {
  13.    $w->configure('-width' => $x,'-height' => $y);
  14.   }
  15.  else
  16.   {
  17.    $w->configure('-width' => $y,'-height' => $x);
  18.   }
  19. }
  20.  
  21. 1;
  22.