From bec8a4b1c6682d7ed2a7234961773fa9fa14af05 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sun, 18 Mar 2012 16:56:04 +0000 Subject: [PATCH] Fixed: scroll views with a bezel border had two strange dots in the upper corners instead of a Lion-like bezel. --- AppKit/CPScrollView.j | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/AppKit/CPScrollView.j b/AppKit/CPScrollView.j index fb6e986db..fe28d027b 100644 --- a/AppKit/CPScrollView.j +++ b/AppKit/CPScrollView.j @@ -1268,37 +1268,24 @@ Notifies the delegate when the scroll view has finished scrolling. var minX = _CGRectGetMinX(aRect), maxX = _CGRectGetMaxX(aRect), minY = _CGRectGetMinY(aRect), - maxY = _CGRectGetMaxY(aRect); + maxY = _CGRectGetMaxY(aRect), + y = minY + 0.5; - CGContextBeginPath(context); + // Slightly darker line on top. CGContextSetStrokeColor(context, [CPColor colorWithWhite:142.0 / 255.0 alpha:1.0]); - - var y = minY + 0.5; - + CGContextBeginPath(context); CGContextMoveToPoint(context, minX, y); - CGContextAddLineToPoint(context, minX + 1.0, y); - CGContextStrokePath(context); - - CGContextBeginPath(context); - CGContextSetStrokeColor(context, [CPColor colorWithWhite:192.0 / 255.0 alpha:1.0]); - CGContextMoveToPoint(context, minX + 1.0, y); - CGContextAddLineToPoint(context, maxX - 1.0, y); - CGContextStrokePath(context); - - CGContextBeginPath(context); - CGContextSetStrokeColor(context, [CPColor colorWithWhite:142.0 / 255.0 alpha:1.0]); - CGContextMoveToPoint(context, maxX - 1.0, y); CGContextAddLineToPoint(context, maxX, y); CGContextStrokePath(context); - CGContextBeginPath(context); - CGContextSetStrokeColor(context, [CPColor colorWithWhite:190.0 / 255.0 alpha:1.0]); + // The rest of the border. + CGContextSetStrokeColor(context, [CPColor colorWithWhite:192.0 / 255.0 alpha:1.0]); var x = maxX - 0.5; + CGContextBeginPath(context); CGContextMoveToPoint(context, x, minY + 1.0); CGContextAddLineToPoint(context, x, maxY); - CGContextMoveToPoint(context, x - 0.5, maxY - 0.5); CGContextAddLineToPoint(context, minX, maxY - 0.5);