ericdrowell / KineticJS

KineticJS is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://www.kineticjs.com
3.98k stars 753 forks source link

LinearGradient not working #1050

Closed minayko closed 9 years ago

minayko commented 9 years ago

Hi :) In the 5.1 version of Kinetic, we can't fill the star :

var wave =  new Kinetic.Star({
                x: 100,
                y: 200,
                numPoints: 5,
                innerRadius: 70,
                outerRadius: 70,
                stroke: 'black',
                strokeWidth: 4,
                fillLinearGradientStartPoint: [0, 0],
                fillLinearGradientEndPoint: [1420, 426],
                fillLinearGradientColorStops: [0, "#EA493B", 1, "#E32486"]
            });

This is not working on Chrome + Firefox whereas with an old version of Kinetic (v4.5.4), this is working perfectly ! (I don't speak very well english, sorry) Thanks in advance !

lavrton commented 9 years ago

API changes:

var wave =  new Kinetic.Star({
  x: 100,
  y: 200,
  numPoints: 5,
  innerRadius: 70,
  outerRadius: 70,
  stroke: 'black',
  strokeWidth: 4,
  fillLinearGradientStartPoint: {
    x : 0, y : 0
  },
  fillLinearGradientEndPoint: {x : 20, y : 20},
  fillLinearGradientColorStops: [0, "#EA493B", 1, "#E32486"]
});

http://jsbin.com/toqexe/1/edit