From ea1b48967ce34718d2645c4a30fab6b67e66f9fa Mon Sep 17 00:00:00 2001 From: avenjamin Date: Sun, 20 Dec 2009 01:19:52 +0000 Subject: - Updating Growl to 1.2 - Updating BWToolkit to 1.2.2 - Changed BWToolkit from building it ourselves to just include the latest release of the framework - Changed build settings to build 32 and 64 universal binaries - Changed compiler to Clang --- .../NSColor+BWAdditions.m | 79 ---------------------- 1 file changed, 79 deletions(-) delete mode 100644 Frameworks/BWToolkitFramework.framework/NSColor+BWAdditions.m (limited to 'Frameworks/BWToolkitFramework.framework/NSColor+BWAdditions.m') diff --git a/Frameworks/BWToolkitFramework.framework/NSColor+BWAdditions.m b/Frameworks/BWToolkitFramework.framework/NSColor+BWAdditions.m deleted file mode 100644 index 4482bd16..00000000 --- a/Frameworks/BWToolkitFramework.framework/NSColor+BWAdditions.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// NSColor+PixelWideLines.m -// BWToolkit -// -// Created by Brandon Walkin (www.brandonwalkin.com) -// All code is provided under the New BSD license. -// - -#import "NSColor+BWAdditions.h" - -@implementation NSColor (BWAdditions) - -// Use this method to draw 1 px wide lines independent of scale factor. Handy for resolution independent drawing. Still needs some work - there are issues with drawing at the edges of views. -- (void)drawPixelThickLineAtPosition:(int)posInPixels withInset:(int)insetInPixels inRect:(NSRect)aRect inView:(NSView *)view horizontal:(BOOL)isHorizontal flip:(BOOL)shouldFlip -{ - // Convert the given rectangle from points to pixels - aRect = [view convertRectToBase:aRect]; - - // Round up the rect's values to integers - aRect = NSIntegralRect(aRect); - - // Add or subtract 0.5 so the lines are drawn within pixel bounds - if (isHorizontal) - { - if ([view isFlipped]) - aRect.origin.y -= 0.5; - else - aRect.origin.y += 0.5; - } - else - { - aRect.origin.x += 0.5; - } - - NSSize sizeInPixels = aRect.size; - - // Convert the rect back to points for drawing - aRect = [view convertRectFromBase:aRect]; - - // Flip the position so it's at the other side of the rect - if (shouldFlip) - { - if (isHorizontal) - posInPixels = sizeInPixels.height - posInPixels - 1; - else - posInPixels = sizeInPixels.width - posInPixels - 1; - } - - float posInPoints = posInPixels / [[NSScreen mainScreen] userSpaceScaleFactor]; - float insetInPoints = insetInPixels / [[NSScreen mainScreen] userSpaceScaleFactor]; - - // Calculate line start and end points - float startX, startY, endX, endY; - - if (isHorizontal) - { - startX = aRect.origin.x + insetInPoints; - startY = aRect.origin.y + posInPoints; - endX = aRect.origin.x + aRect.size.width - insetInPoints; - endY = aRect.origin.y + posInPoints; - } - else - { - startX = aRect.origin.x + posInPoints; - startY = aRect.origin.y + insetInPoints; - endX = aRect.origin.x + posInPoints; - endY = aRect.origin.y + aRect.size.height - insetInPoints; - } - - // Draw line - NSBezierPath *path = [NSBezierPath bezierPath]; - [path setLineWidth:0.0f]; - [path moveToPoint:NSMakePoint(startX,startY)]; - [path lineToPoint:NSMakePoint(endX,endY)]; - [self set]; - [path stroke]; -} - -@end -- cgit v1.2.3