Revision: 5817
http://skim-app.svn.sourceforge.net/skim-app/?rev=5817&view=rev
Author: hofman
Date: 2009-09-26 23:36:01 +0000 (Sat, 26 Sep 2009)
Log Message:
-----------
move code for bezierpath method used only once to place where it's used
Modified Paths:
--------------
trunk/NSBezierPath_SKExtensions.h
trunk/NSBezierPath_SKExtensions.m
trunk/SKPDFToolTipWindow.m
Modified: trunk/NSBezierPath_SKExtensions.h
===================================================================
--- trunk/NSBezierPath_SKExtensions.h 2009-09-26 23:20:35 UTC (rev 5816)
+++ trunk/NSBezierPath_SKExtensions.h 2009-09-26 23:36:01 UTC (rev 5817)
@@ -43,8 +43,6 @@
+ (NSBezierPath *)bezierPathWithLeftRoundedRect:(NSRect)rect
radius:(CGFloat)radius;
+ (NSBezierPath *)bezierPathWithRightRoundedRect:(NSRect)rect
radius:(CGFloat)radius;
-+ (NSBezierPath*)bezierPathWithHorizontalOvalAroundRect:(NSRect)rect;
-
- (NSRect)nonEmptyBounds;
- (NSPoint)associatedPointForElementAtIndex:(NSUInteger)anIndex;
Modified: trunk/NSBezierPath_SKExtensions.m
===================================================================
--- trunk/NSBezierPath_SKExtensions.m 2009-09-26 23:20:35 UTC (rev 5816)
+++ trunk/NSBezierPath_SKExtensions.m 2009-09-26 23:36:01 UTC (rev 5817)
@@ -97,26 +97,6 @@
return path;
}
-+ (NSBezierPath *)bezierPathWithHorizontalOvalAroundRect:(NSRect)rect
-{
- CGFloat radius = 0.5f * rect.size.height;
- NSBezierPath *path = [self bezierPath];
-
- [path removeAllPoints];
-
- // Now draw our rectangle:
- [path moveToPoint: NSMakePoint(NSMinX(rect), NSMaxY(rect))];
-
- // Left half circle:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect),
NSMidY(rect)) radius:radius startAngle:90.0 endAngle:270.0];
- // Bottom edge and right half circle:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect),
NSMidY(rect)) radius:radius startAngle:-90.0 endAngle:90.0];
- // Top edge:
- [path closePath];
-
- return path;
-}
-
- (NSPoint)associatedPointForElementAtIndex:(NSUInteger)anIndex {
NSPoint points[3];
if (NSCurveToBezierPathElement == [self elementAtIndex:anIndex
associatedPoints:points])
Modified: trunk/SKPDFToolTipWindow.m
===================================================================
--- trunk/SKPDFToolTipWindow.m 2009-09-26 23:20:35 UTC (rev 5816)
+++ trunk/SKPDFToolTipWindow.m 2009-09-26 23:36:01 UTC (rev 5817)
@@ -40,7 +40,6 @@
#import "PDFPage_SKExtensions.h"
#import <SkimNotes/SkimNotes.h>
#import "PDFAnnotation_SKExtensions.h"
-#import "NSBezierPath_SKExtensions.h"
#import "NSParagraphStyle_SKExtensions.h"
#import "NSGeometry_SKExtensions.h"
#import "NSAffineTransform_SKExtensions.h"
@@ -262,10 +261,20 @@
image = [[NSImage alloc] initWithSize:targetRect.size];
[image lockFocus];
+
[pageImage drawInRect:targetRect fromRect:sourceRect
operation:NSCompositeCopy fraction:1.0];
+
+ CGFloat radius = 0.5 * NSHeight(labelRect);
+ NSBezierPath *path = [NSBezierPath bezierPath];
+
+ [path moveToPoint:SKTopLeftPoint(labelRect)];
+ [path
appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(labelRect),
NSMidY(labelRect)) radius:radius startAngle:90.0 endAngle:270.0];
+ [path
appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(labelRect),
NSMidY(labelRect)) radius:radius startAngle:-90.0 endAngle:90.0];
+ [path closePath];
+
[labelColor setFill];
- [[NSBezierPath bezierPathWithHorizontalOvalAroundRect:labelRect]
fill];
[labelString drawWithRect:labelRect
options:NSStringDrawingUsesLineFragmentOrigin];
+
[image unlockFocus];
[attrs release];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit