Revision: 5897
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5897&view=rev
Author:   hofman
Date:     2009-10-16 15:57:24 +0000 (Fri, 16 Oct 2009)

Log Message:
-----------
rounded rect for color swatch in notes table

Modified Paths:
--------------
    trunk/SKColorCell.m

Modified: trunk/SKColorCell.m
===================================================================
--- trunk/SKColorCell.m 2009-10-16 14:54:09 UTC (rev 5896)
+++ trunk/SKColorCell.m 2009-10-16 15:57:24 UTC (rev 5897)
@@ -50,12 +50,13 @@
     NSColor *color = [self objectValue];
     if ([color respondsToSelector:@selector(drawSwatchInRect:)]) {
         color = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-        NSRect rect = cellFrame;
-        CGFloat height = SKMin(NSWidth(cellFrame), NSHeight(cellFrame));
-        CGFloat offset = 0.5 * (NSHeight(cellFrame) - height);
+        NSRect rect = NSInsetRect(cellFrame, 1.0, 1.0);
+        CGFloat height = SKMin(NSWidth(rect), NSHeight(rect));
+        CGFloat offset = 0.5 * (NSHeight(rect) - height);
         rect.origin.y += [controlView isFlipped] ? SKFloor(offset) - 1.0 : 
SKCeil(offset) + 1.0;
         rect.size.height = height;
-        [color drawSwatchInRect:NSInsetRect(rect, 1.0, 1.0)];
+        [[NSBezierPath bezierPathWithRoundedRect:rect xRadius:2.0 yRadius:2.0] 
addClip];
+        [color drawSwatchInRect:rect];
     }
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) 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/devconference
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to