mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 09:02:50 +00:00
Allow null locations per Quartz 2D documentation.
See http://developer.apple.com/library/ios/#DOCUMENTATION/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_shadings/dq_shadings.html%23//apple_ref/doc/uid/TP30001066-CH207-TPXREF101
This commit is contained in:
1 parent
ffcbf87858
commit
23a654d57a
1 file changed
+5
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user