Revision: 18410
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18410&view=rev
Author:   amaxwell
Date:     2012-01-17 04:23:23 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
Use visibleRect for gradient calculations.
Disable copy on scroll when drawing the gradient, as it shows an obvious 
transition now that the correct rect is used.

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2012-01-16 
18:29:42 UTC (rev 18409)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2012-01-17 
04:23:23 UTC (rev 18410)
@@ -2421,6 +2421,10 @@
          */
         FVAPIAssert(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6, 
@"gradient background is only available on 10.7 and later");
         
+        // otherwise we see a blocky transition, which fades on the redraw 
when scrolling stops
+        if ([[[self enclosingScrollView] contentView] copiesOnScroll])
+            [[[self enclosingScrollView] contentView] setCopiesOnScroll:NO];
+            
         // should be RGBA space, since we're drawing to the screen
         CGColorSpaceRef cspace = 
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
         const CGFloat locations[] = { 0, 1 };
@@ -2439,10 +2443,10 @@
         }
         CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicsPort];
 
-        // only draw the dirty part, but we need to use the full view bounds 
as the gradient extent
+        // only draw the dirty part, but we need to use the full visible 
bounds as the gradient extent
         CGContextSaveGState(ctxt);
         CGContextClipToRect(ctxt, NSRectToCGRect(rect));
-        const NSRect bounds = [self bounds];
+        const NSRect bounds = [self visibleRect];
         CGContextDrawLinearGradient(ctxt, gradient, CGPointMake(0, 
NSMaxY(bounds)), CGPointMake(0, NSMinY(bounds)), 0);
         CGContextRestoreGState(ctxt);
 

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


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to