Revision: 5852
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5852&view=rev
Author:   hofman
Date:     2009-10-05 16:58:41 +0000 (Mon, 05 Oct 2009)

Log Message:
-----------
change calculation of cell drawing

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

Modified: trunk/SKAnnotationTypeImageCell.m
===================================================================
--- trunk/SKAnnotationTypeImageCell.m   2009-10-05 16:56:12 UTC (rev 5851)
+++ trunk/SKAnnotationTypeImageCell.m   2009-10-05 16:58:41 UTC (rev 5852)
@@ -104,10 +104,9 @@
         else
             [[NSColor colorWithCalibratedWhite:0.0 alpha:0.7] set];
         NSRect rect = cellFrame;
-        CGFloat width = NSWidth(cellFrame);
-        CGFloat height = SKMin(width, NSHeight(cellFrame) - 1.0);
-        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;
+        CGFloat height = SKMin(NSWidth(cellFrame), NSHeight(cellFrame) - 1.0);
+        CGFloat offset = 0.5 * (NSHeight(cellFrame) - height);
+        rect.origin.y += [controlView isFlipped] ? SKCeil(offset) - 1.0 : 
SKFloor(offset) + 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 16:56:12 UTC (rev 5851)
+++ trunk/SKColorCell.m 2009-10-05 16:58:41 UTC (rev 5852)
@@ -52,8 +52,8 @@
         color = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
         NSRect rect = cellFrame;
         CGFloat height = SKMin(NSWidth(cellFrame), NSHeight(cellFrame));
-        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;
+        CGFloat offset = NSMinY(rect) + 0.5 * (NSHeight(cellFrame) - 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)];
     }


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

Reply via email to