Gradient: rename midPoint to rampPoint.

This commit is contained in:
Jonathan Puckey 2011-04-07 17:12:00 +02:00
parent 277cf541de
commit 5f05c85b42

View file

@ -38,18 +38,18 @@ var Gradient = this.Gradient = Base.extend({
'Gradient stop list needs to contain at least two stops.'); 'Gradient stop list needs to contain at least two stops.');
if(!(stops[0] instanceof GradientStop)) { if(!(stops[0] instanceof GradientStop)) {
for(var i = 0, l = stops.length; i < l; i++) { for(var i = 0, l = stops.length; i < l; i++) {
var midPoint; var rampPoint;
var stop = stops[i]; var stop = stops[i];
// If it is an array, the second argument is the midPoint: // If it is an array, the second argument is the rampPoint:
if(stop.length) { if(stop.length) {
midPoint = stop[1]; rampPoint = stop[1];
stop = stop[0]; stop = stop[0];
} else { } else {
// Otherwise stops is an array of colors, and we need to // Otherwise stops is an array of colors, and we need to
// calculate the midPoint: // calculate the midPoint:
midPoint = i / (l - 1); rampPoint = i / (l - 1);
} }
stops[i] = new GradientStop(stop, midPoint); stops[i] = new GradientStop(stop, rampPoint);
} }
} }
this._stops = stops; this._stops = stops;