Fix RadialRainbows example.

The example stopped working, because we were changing values on another gradient colour object than the one used by the path: the color is cloned when passed to path.fillColor
This commit is contained in:
Jonathan Puckey 2012-11-22 20:05:01 +01:00
parent d12c680be6
commit e1bb0a23e7

View file

@ -20,8 +20,8 @@
var path = new Path.Rectangle(view.bounds);
var gradient = new Gradient(colors, 'radial');
var radius = Math.max(view.size.width, view.size.height) * 0.75;
var gradientColor = new GradientColor(gradient, point, point + [radius, 0]);
path.fillColor = gradientColor;
path.fillColor = new GradientColor(gradient, point, point + [radius, 0]);
var gradientColor = path.fillColor;
var mouseDown = false,
mousePoint = view.center;