mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -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
|
||||
// receive a boolean value?
|
||||
initialize: function(stops, type) {
|
||||
if (!stops) {
|
||||
stops = [new GradientStop('white', 0),
|
||||
new GradientStop('black', 1)];
|
||||
}
|
||||
this.setStops(stops);
|
||||
this.type = type ? type : 'linear';
|
||||
this.setStops(stops || ['white', 'black']);
|
||||
this.type = type || 'linear';
|
||||
},
|
||||
|
||||
getStops: function() {
|
||||
|
|
Loading…
Reference in a new issue