Revision: 2960
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2960&view=rev
Author:   hofman
Date:     2007-09-21 09:01:10 -0700 (Fri, 21 Sep 2007)

Log Message:
-----------
Simplify blending splitview divider ends using transparent color.

Modified Paths:
--------------
    trunk/CIImage_BDSKExtensions.h
    trunk/CIImage_BDSKExtensions.m
    trunk/SKSplitView.m

Modified: trunk/CIImage_BDSKExtensions.h
===================================================================
--- trunk/CIImage_BDSKExtensions.h      2007-09-21 15:32:11 UTC (rev 2959)
+++ trunk/CIImage_BDSKExtensions.h      2007-09-21 16:01:10 UTC (rev 2960)
@@ -79,4 +79,6 @@
 
 + (CIColor *)colorWithNSColor:(NSColor *)color;
 
++ (CIColor *)clearColor;
+
 @end 

Modified: trunk/CIImage_BDSKExtensions.m
===================================================================
--- trunk/CIImage_BDSKExtensions.m      2007-09-21 15:32:11 UTC (rev 2959)
+++ trunk/CIImage_BDSKExtensions.m      2007-09-21 16:01:10 UTC (rev 2960)
@@ -216,4 +216,9 @@
     return [CIColor colorWithRed:[color redComponent] green:[color 
greenComponent] blue:[color blueComponent] alpha:[color alphaComponent]];
 }
 
++ (CIColor *)clearColor;
+{
+    return [self colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0];
+}
+
 @end

Modified: trunk/SKSplitView.m
===================================================================
--- trunk/SKSplitView.m 2007-09-21 15:32:11 UTC (rev 2959)
+++ trunk/SKSplitView.m 2007-09-21 16:01:10 UTC (rev 2960)
@@ -86,33 +86,6 @@
     [super mouseDown:theEvent];
 }
 
-- (void)drawBlendedJoinEndAtLeftInRect:(NSRect)rect {
-    // this blends us smoothly with the a vertical divider on our left
-    Class svClass = [self class];
-    [[NSBezierPath bezierPathWithRect:rect] fillPathWithColor:[svClass 
startColor]
-                                               blendedAtRight:NO
-                                  ofVerticalGradientFromColor:[svClass 
startColor]
-                                                      toColor:[svClass 
endColor]];
-}
-
-- (void)drawBlendedJoinEndAtRightInRect:(NSRect)rect {
-    // this blends us smoothly with the a vertical divider on our right
-    Class svClass = [self class];
-    [[NSBezierPath bezierPathWithRect:rect] fillPathWithColor:[svClass 
endColor]
-                                               blendedAtRight:YES
-                                  ofVerticalGradientFromColor:[svClass 
startColor]
-                                                      toColor:[svClass 
endColor]];
-}
-
-- (void)drawBlendedJoinEndAtTopInRect:(NSRect)rect {
-    // this blends us smoothly with the a vertical divider on our left
-    Class svClass = [self class];
-    [[NSBezierPath bezierPathWithRect:rect] fillPathWithColor:[svClass 
startColor]
-                                               blendedAtRight:NO
-                                  ofVerticalGradientFromColor:[svClass 
startColor]
-                                                      toColor:[svClass 
endColor]];
-}
-
 - (void)drawDividerInRect:(NSRect)aRect {
     NSPoint startPoint, endPoint;
     float handleSize = 20.0;
@@ -122,12 +95,12 @@
     // Draw the gradient
     [[NSBezierPath bezierPathWithRect:aRect] fillPathVertically:NO == [self 
isVertical] withStartColor:[[self class] startColor] endColor:[[self class] 
endColor]];
     
-    if (blendEnds && [self isVertical] == NO) {
+    if (blendEnds) {
         NSRect endRect, ignored;
-        NSDivideRect(aRect, &endRect, &ignored, END_JOIN_WIDTH, NSMinXEdge);
-        [self drawBlendedJoinEndAtLeftInRect:endRect];
-        NSDivideRect(aRect, &endRect, &ignored, END_JOIN_WIDTH, NSMaxXEdge);
-        [self drawBlendedJoinEndAtRightInRect:endRect];
+        NSDivideRect(aRect, &endRect, &ignored, END_JOIN_WIDTH, [self 
isVertical] ? NSMinYEdge : NSMinXEdge);
+        [[NSBezierPath bezierPathWithRect:endRect] fillPathVertically:[self 
isVertical] withStartColor:[CIColor clearColor] endColor:[[self class] 
startColor]];
+        NSDivideRect(aRect, &endRect, &ignored, END_JOIN_WIDTH, [self 
isVertical] ? NSMaxYEdge : NSMaxXEdge);
+        [[NSBezierPath bezierPathWithRect:endRect] fillPathVertically:[self 
isVertical] withStartColor:[[self class] endColor] endColor:[CIColor 
clearColor]];
     }
     
     [NSGraphicsContext saveGraphicsState];


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to