mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 22:01:58 -05:00
Optimise Gradient constructor.
This commit is contained in:
parent
8eea7e15d4
commit
6348f94362
1 changed files with 2 additions and 6 deletions
|
@ -20,12 +20,8 @@ var Gradient = this.Gradient = Base.extend({
|
||||||
// TODO: should type here be called 'radial' and have it
|
// TODO: should type here be called 'radial' and have it
|
||||||
// receive a boolean value?
|
// receive a boolean value?
|
||||||
initialize: function(stops, type) {
|
initialize: function(stops, type) {
|
||||||
if (!stops) {
|
this.setStops(stops || ['white', 'black']);
|
||||||
stops = [new GradientStop('white', 0),
|
this.type = type || 'linear';
|
||||||
new GradientStop('black', 1)];
|
|
||||||
}
|
|
||||||
this.setStops(stops);
|
|
||||||
this.type = type ? type : 'linear';
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getStops: function() {
|
getStops: function() {
|
||||||
|
|
Loading…
Reference in a new issue