Revision: 3278
http://skim-app.svn.sourceforge.net/skim-app/?rev=3278&view=rev
Author: hofman
Date: 2007-11-28 12:50:21 -0800 (Wed, 28 Nov 2007)
Log Message:
-----------
Set default line width when using stroke. The line width sometimes gets changed
outside our control.
Modified Paths:
--------------
trunk/SKBookmarkController.m
trunk/SKColorSwatch.m
trunk/SKLineWell.m
trunk/SKMainWindowController.m
trunk/SKNavigationWindow.m
trunk/SKNoteOutlineView.m
trunk/SKPDFView.m
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2007-11-28 20:47:10 UTC (rev 3277)
+++ trunk/SKBookmarkController.m 2007-11-28 20:50:21 UTC (rev 3278)
@@ -766,6 +766,7 @@
float indent = [self levelForItem:[self itemAtRow:rowIndex]] * [self
indentationPerLevel];
NSRect rect = [self rectOfRow:rowIndex];
[[NSColor gridColor] setStroke];
+ [NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeLineFromPoint:NSMakePoint(NSMinX(rect) + indent +
SEPARATOR_LEFT_INDENT, floorf(NSMidY(rect)) + 0.5)
toPoint:NSMakePoint(NSMaxX(rect) - SEPARATOR_RIGHT_INDENT, floorf(NSMidY(rect))
+ 0.5)];
} else {
[super drawRow:rowIndex clipRect:clipRect];
Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m 2007-11-28 20:47:10 UTC (rev 3277)
+++ trunk/SKColorSwatch.m 2007-11-28 20:50:21 UTC (rev 3278)
@@ -142,6 +142,7 @@
for (i = 0; i < count; i++) {
NSColor *borderColor = [NSColor colorWithCalibratedWhite:0.66667
alpha:1.0];
[borderColor set];
+ [NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeRect:NSInsetRect(r, 0.5, 0.5)];
borderColor = highlightedIndex == i ? [NSColor selectedControlColor] :
[NSColor controlBackgroundColor];
[borderColor set];
@@ -197,6 +198,7 @@
NSImage *image = [[NSImage alloc] initWithSize:rect.size];
[image lockFocus];
[[NSColor blackColor] set];
+ [NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeRect:NSInsetRect(rect, 0.5, 0.5)];
[color drawSwatchInRect:NSInsetRect(rect, 1.0, 1.0)];
[image unlockFocus];
Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m 2007-11-28 20:47:10 UTC (rev 3277)
+++ trunk/SKLineWell.m 2007-11-28 20:50:21 UTC (rev 3278)
@@ -299,6 +299,7 @@
[[NSBezierPath bezierPathWithRect:rect] addClip];
[[NSColor blackColor] setStroke];
+ [NSBezierPath setDefaultLineWidth:1.0];
[[self path] stroke];
[NSGraphicsContext restoreGraphicsState];
@@ -322,6 +323,7 @@
NSRectFill(bounds);
[[NSColor controlBackgroundColor] setFill];
NSRectFill(NSInsetRect(bounds, 2.0, 2.0));
+ [NSBezierPath setDefaultLineWidth:1.0];
[[self path] stroke];
[image unlockFocus];
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2007-11-28 20:47:10 UTC (rev 3277)
+++ trunk/SKMainWindowController.m 2007-11-28 20:50:21 UTC (rev 3278)
@@ -3405,6 +3405,7 @@
[image lockFocus];
[[NSColor lightGrayColor] setStroke];
+ [NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeRect:lineRect];
[color drawSwatchInRect:swatchRect];
[image unlockFocus];
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2007-11-28 20:47:10 UTC (rev 3277)
+++ trunk/SKNavigationWindow.m 2007-11-28 20:50:21 UTC (rev 3278)
@@ -181,12 +181,15 @@
@implementation SKNavigationContentView
- (void)drawRect:(NSRect)rect {
+ [[NSGraphicsContext currentContext] saveGraphicsState];
rect = NSInsetRect([self bounds], 1.0, 1.0);
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.5] set];
[NSBezierPath fillRoundRectInRect:rect radius:10.0];
rect = NSInsetRect([self bounds], 0.5, 0.5);
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.2] set];
+ [NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeRoundRectInRect:rect radius:10.0];
+ [[NSGraphicsContext currentContext] restoreGraphicsState];
}
@end
Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m 2007-11-28 20:47:10 UTC (rev 3277)
+++ trunk/SKNoteOutlineView.m 2007-11-28 20:50:21 UTC (rev 3278)
@@ -390,6 +390,7 @@
NSRect rect = cellFrame;
rect.origin.y = floorf(NSMinY(rect) + 0.5 * (NSHeight(cellFrame) -
NSWidth(cellFrame)));
rect.size.height = NSWidth(rect);
+ [NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeRect:NSInsetRect(rect, 0.5, 0.5)];
[[NSGraphicsContext currentContext] restoreGraphicsState];
}
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-11-28 20:47:10 UTC (rev 3277)
+++ trunk/SKPDFView.m 2007-11-28 20:50:21 UTC (rev 3278)
@@ -3413,6 +3413,7 @@
[self lockFocus];
[[NSColor blackColor] set];
+ [NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeRect:NSInsetRect(NSIntegralRect([self
convertRect:selRect fromView:[self documentView]]), 0.5, 0.5)];
[self unlockFocus];
[[self window] enableFlushWindow];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit