Logo Search packages:      
Sourcecode: viewpdf.app version File versions  Download package

- (NSSize) zoomContentToFit: (NSSize)  aSize   [implementation]

Zoom the view's contents to fit the given size. If the view cannot zoom, do nothing and simply return the aSize. Otherwise, the view should zoom it's contents and return the content's size after zooming. This size may be smaller than the given size but it must not be larger.

Reimplemented from < PDFContentView >.

Definition at line 121 of file SinglePageView.m.

References zoom.

                           : (NSSize)aSize
   NSSize normalized = [document pageSize];

   float xFactor = aSize.width / normalized.width;
   float yFactor = aSize.height / normalized.height;
   float factor = (xFactor < yFactor ? xFactor : yFactor);
   [zoom setFactor: [ZoomFactor factorWithValue: 100.0 * factor]];

   return [self _zoomedSize];

Generated by  Doxygen 1.6.0   Back to index