Merge branch 'CGGradientCreateWithColorComponents-location-fix' of http://github.com/eventualbuddha/cappuccino

This commit is contained in:
Alexander Ljungberg committed 2010-09-28 19:29:46 -04:00
commit 28cf834e0b
1 file changed
+5 -2
+5 -2
View File
@@ -29,17 +29,20 @@ kCGGradientDrawsAfterEndLocation = 1 << 1;
function CGGradientCreateWithColorComponents(aColorSpace, components, locations, count)
{
if (arguments["locations"] == NULL)
var locations = [0.0, 1.0];
if (arguments["count"] == NULL)
var count = locations.length;
var colors = [];
while (count--)
{
var offset = count * 4;
colors[count] = CGColorCreate(aColorSpace, components.slice(offset, offset + 4));
}
return CGGradientCreateWithColors(aColorSpace, colors, locations);
}