Revision: 5845
http://skim-app.svn.sourceforge.net/skim-app/?rev=5845&view=rev
Author: hofman
Date: 2009-10-05 12:29:44 +0000 (Mon, 05 Oct 2009)
Log Message:
-----------
change drawing offsets in type and color cell
Modified Paths:
--------------
trunk/SKAnnotationTypeImageCell.m
trunk/SKColorCell.m
Modified: trunk/SKAnnotationTypeImageCell.m
===================================================================
--- trunk/SKAnnotationTypeImageCell.m 2009-10-05 12:10:18 UTC (rev 5844)
+++ trunk/SKAnnotationTypeImageCell.m 2009-10-05 12:29:44 UTC (rev 5845)
@@ -106,7 +106,8 @@
NSRect rect = cellFrame;
CGFloat width = NSWidth(cellFrame);
CGFloat height = SKMin(width, NSHeight(cellFrame) - 1.0);
- rect.origin.y = SKFloor(NSMinY(rect) + 0.5 * (NSHeight(cellFrame) -
height));
+ rect.origin.y = NSMinY(rect) + 0.5 * (NSHeight(cellFrame) - height);
+ rect.origin.y = [controlView isFlipped] ? SKCeil(NSMinY(rect)) - 1.0 :
SKFloor(NSMinY(rect)) + 1.0;
rect.size.height = height;
[NSBezierPath setDefaultLineWidth:1.0];
[NSBezierPath strokeRect:NSInsetRect(rect, 0.5, 0.5)];
Modified: trunk/SKColorCell.m
===================================================================
--- trunk/SKColorCell.m 2009-10-05 12:10:18 UTC (rev 5844)
+++ trunk/SKColorCell.m 2009-10-05 12:29:44 UTC (rev 5845)
@@ -48,9 +48,12 @@
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSColor *color = [self objectValue];
if ([color respondsToSelector:@selector(drawSwatchInRect:)]) {
- NSRect rect, ignored;
- NSDivideRect(cellFrame, &ignored, &rect, 1.0, [controlView isFlipped]
? NSMaxYEdge : NSMinYEdge);
- [color drawSwatchInRect:rect];
+ NSRect rect = cellFrame;
+ CGFloat height = SKMin(NSWidth(cellFrame), NSHeight(cellFrame) - 1.0);
+ rect.origin.y = NSMinY(rect) + 0.5 * (NSHeight(cellFrame) - height);
+ rect.origin.y = [controlView isFlipped] ? SKFloor(NSMinY(rect)) - 1.0
: SKCeil(NSMinY(rect)) + 1.0;
+ rect.size.height = height;
+ [color drawSwatchInRect:NSInsetRect(rect, 1.0, 1.0)];
}
}
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