From ce22cebf076f865de1896a97f5f784faa39ee747 Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Mon, 20 May 2013 21:53:35 -0700 Subject: [PATCH] Removed the reverse colors (it was a bad idea) --- AppKit/CPGradient.j | 4 ---- AppKit/CoreGraphics/CGContextCanvas.j | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/AppKit/CPGradient.j b/AppKit/CPGradient.j index 0c42d0176..dfa7a3437 100644 --- a/AppKit/CPGradient.j +++ b/AppKit/CPGradient.j @@ -70,10 +70,6 @@ CPGradientDrawsAfterEndingLocation = kCGGradientDrawsAfterEndLocation; { if (self = [super init]) { - // We reverse the location because we reverse the colors in CGContextDrawLinearGradient - // This is needed to get the same behavior as Cocoa when drawing a CGContextDrawLinearGradient without the object CPGradient - someLocations.reverse(); - var cgColors = [], count = [someColors count], colorSpace = [aColorSpace CGColorSpace] || CGColorSpaceCreateDeviceRGB; diff --git a/AppKit/CoreGraphics/CGContextCanvas.j b/AppKit/CoreGraphics/CGContextCanvas.j index e531ca463..030f8c738 100644 --- a/AppKit/CoreGraphics/CGContextCanvas.j +++ b/AppKit/CoreGraphics/CGContextCanvas.j @@ -594,7 +594,7 @@ function to_string(aColor) function CGContextDrawLinearGradient(aContext, aGradient, aStartPoint, anEndPoint, options) { - var colors = aGradient.colors.slice(0).reverse(), + var colors = aGradient.colors, count = colors.length, linearGradient = aContext.createLinearGradient(aStartPoint.x, aStartPoint.y, anEndPoint.x, anEndPoint.y);