Revision: 2717
http://skim-app.svn.sourceforge.net/skim-app/?rev=2717&view=rev
Author: hofman
Date: 2007-08-24 07:16:09 -0700 (Fri, 24 Aug 2007)
Log Message:
-----------
Use geometry category convenience method. No need to save the graphics state as
lockFocus/unlockFocus makes sure the graphics state is setup initially.
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-08-24 09:55:24 UTC (rev 2716)
+++ trunk/SKPDFView.m 2007-08-24 14:16:09 UTC (rev 2717)
@@ -3374,12 +3374,10 @@
int originalLevel = [theEvent clickCount]; // this should be at least 1
BOOL postNotification = [documentView postsBoundsChangedNotifications];
NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
- float smallWidth = [sud floatForKey:@"SKSmallMagnificationWidth"];
- float smallHeight = [sud floatForKey:@"SKSmallMagnificationHeight"];
- float largeWidth = [sud floatForKey:@"SKLargeMagnificationWidth"];
- float largeHeight = [sud floatForKey:@"SKLargeMagnificationHeight"];
- NSRect smallMagRect = NSMakeRect(-0.5 * smallWidth, -0.5 * smallHeight,
smallWidth, smallHeight);
- NSRect largeMagRect = NSMakeRect(-0.5 * largeWidth, -0.5 * largeHeight,
largeWidth, largeHeight);
+ NSSize smallSize = NSMakeSize([sud
floatForKey:@"SKSmallMagnificationWidth"], [sud
floatForKey:@"SKSmallMagnificationHeight"]);
+ NSSize largeSize = NSMakeSize([sud
floatForKey:@"SKLargeMagnificationWidth"], [sud
floatForKey:@"SKLargeMagnificationHeight"]);
+ NSRect smallMagRect = SKRectFromCenterAndSize(NSZeroPoint, smallSize);
+ NSRect largeMagRect = SKRectFromCenterAndSize(NSZeroPoint, largeSize);
NSBezierPath *path;
NSColor *color = [NSColor colorWithCalibratedWhite:0.2 alpha:1.0];
NSShadow *shadow = [[[NSShadow alloc] init] autorelease];
@@ -3438,13 +3436,11 @@
NSWidth(originalBounds) / magnification,
NSHeight(originalBounds) / magnification);
[clipView lockFocus];
- [[NSGraphicsContext currentContext] saveGraphicsState];
outlineRect = [clipView convertRect:magRect fromView:nil];
[shadow set];
[color set];
path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect
radius:9.5];
[path fill];
- [[NSGraphicsContext currentContext] restoreGraphicsState];
[clipView unlockFocus];
[documentView setBounds:magBounds];
@@ -3452,13 +3448,11 @@
[documentView setBounds:originalBounds];
[clipView lockFocus];
- [[NSGraphicsContext currentContext] saveGraphicsState];
outlineRect = NSInsetRect(outlineRect, 1.5, 1.5);
[color set];
path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect
radius:8.0];
[path setLineWidth:3.0];
[path stroke];
- [[NSGraphicsContext currentContext] restoreGraphicsState];
[clipView unlockFocus];
[[self window] enableFlushWindow];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit