Revision: 4013
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4013&view=rev
Author:   hofman
Date:     2008-06-13 04:59:18 -0700 (Fri, 13 Jun 2008)

Log Message:
-----------
Reset gradient layer when frame and/or size changes, as the different methods 
don't go through a common setter.

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

Modified: trunk/BDSKGradientView.m
===================================================================
--- trunk/BDSKGradientView.m    2008-06-13 11:45:04 UTC (rev 4012)
+++ trunk/BDSKGradientView.m    2008-06-13 11:59:18 UTC (rev 4013)
@@ -74,7 +74,36 @@
     [super setBounds:aRect];
 }
 
+- (void)setBoundsSize:(NSSize)aSize
+{
+    // since the gradient is vertical, we only have to reset the layer if the 
height changes; for most of our gradient views, this isn't likely to happen
+    if (ABS(aSize.height - NSHeight([self bounds])) > 0.01) {
+        CGLayerRelease(layer);
+        layer = NULL;
+    }
+    [super setBoundsSize:aSize];
+}
 
+- (void)setFrame:(NSRect)aRect
+{
+    // since the gradient is vertical, we only have to reset the layer if the 
height changes; for most of our gradient views, this isn't likely to happen
+    if (ABS(NSHeight(aRect) - NSHeight([self frame])) > 0.01) {
+        CGLayerRelease(layer);
+        layer = NULL;
+    }
+    [super setFrame:aRect];
+}
+
+- (void)setFrameSize:(NSSize)aSize
+{
+    // since the gradient is vertical, we only have to reset the layer if the 
height changes; for most of our gradient views, this isn't likely to happen
+    if (ABS(aSize.height - NSHeight([self frame])) > 0.01) {
+        CGLayerRelease(layer);
+        layer = NULL;
+    }
+    [super setFrameSize:aSize];
+}
+
 - (void)drawRect:(NSRect)aRect
 {        
     // fill entire view, not just the (possibly clipped) aRect


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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to