Revision: 4718
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4718&view=rev
Author:   hofman
Date:     2008-09-30 12:39:52 +0000 (Tue, 30 Sep 2008)

Log Message:
-----------
Don't draw centered cell in a larger space than available

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

Modified: trunk/SKCenteredTextFieldCell.m
===================================================================
--- trunk/SKCenteredTextFieldCell.m     2008-09-30 12:22:02 UTC (rev 4717)
+++ trunk/SKCenteredTextFieldCell.m     2008-09-30 12:39:52 UTC (rev 4718)
@@ -44,9 +44,11 @@
 
 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
     float height = [self cellSize].height;
-    cellFrame.origin.y += floorf(0.5 * (NSHeight(cellFrame) - height));
-    cellFrame.origin.y += [controlView isFlipped] ? TEXT_OFFSET : -TEXT_OFFSET;
-    cellFrame.size.height = height;
+    if (height < NSHeight(cellFrame)) {
+        cellFrame.origin.y += floorf(0.5 * (NSHeight(cellFrame) - height));
+        cellFrame.origin.y += [controlView isFlipped] ? TEXT_OFFSET : 
-TEXT_OFFSET;
+        cellFrame.size.height = height;
+    }
     [super drawInteriorWithFrame:cellFrame inView:controlView];
 }
 


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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to