Revision: 5688
http://skim-app.svn.sourceforge.net/skim-app/?rev=5688&view=rev
Author: hofman
Date: 2009-09-05 21:28:38 +0000 (Sat, 05 Sep 2009)
Log Message:
-----------
slight changes to calculation of foregroundBox
Modified Paths:
--------------
trunk/SKPDFPage.m
Modified: trunk/SKPDFPage.m
===================================================================
--- trunk/SKPDFPage.m 2009-09-05 19:53:52 UTC (rev 5687)
+++ trunk/SKPDFPage.m 2009-09-05 21:28:38 UTC (rev 5688)
@@ -11,6 +11,7 @@
#import "NSBitmapImageRep_SKExtensions.h"
#import "NSData_SKExtensions.h"
#import "SKPDFAnnotationTemporary.h"
+#import "NSGeometry_SKExtensions.h"
#define SKAutoCropBoxMarginWidthKey @"SKAutoCropBoxMarginWidth"
#define SKAutoCropBoxMarginHeightKey @"SKAutoCropBoxMarginHeight"
@@ -69,13 +70,12 @@
NSRect bounds = [self boundsForBox:kPDFDisplayBoxMediaBox];
foregroundBox = [imageRep foregroundRect];
if (imageRep == nil) {
- foregroundBox = bounds;
- } else if (NSEqualRects(NSZeroRect, foregroundBox)) {
- foregroundBox.origin.x = SKFloor(NSMidX(bounds));
- foregroundBox.origin.x = SKCeil(NSMidY(bounds));
+ foregroundBox = [self boundsForBox:kPDFDisplayBoxMediaBox];
+ } else if (NSIsEmptyRect(foregroundBox)) {
+ foregroundBox.origin = SKIntegralPoint(SKCenterPoint(bounds));
+ foregroundBox.size = NSZeroSize;
} else {
- foregroundBox.origin.x += NSMinX(bounds);
- foregroundBox.origin.y += NSMinY(bounds);
+ foregroundBox.origin = SKAddPoints(foregroundBox.origin,
bounds.origin);
}
[imageRep release];
foregroundBox = NSIntersectionRect(NSInsetRect(foregroundBox,
-marginWidth, -marginHeight), bounds);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit