Skip to content

Commit

Permalink
Add test for strokeScaling gradients
Browse files Browse the repository at this point in the history
  • Loading branch information
adroitwhiz committed Jun 9, 2020
1 parent fa6309d commit c9d1c88
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/tests/Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,41 @@ test('Gradients with applyMatrix', function() {
comparePixels(path, shape);
});

test('Gradients with strokeScaling: false', function() {
var topLeft = [100, 100];
var bottomRight = [400, 400];
var gradientColor = {
gradient: {
stops: ['yellow', 'red', 'blue']
},
origin: topLeft,
destination: bottomRight
}

var path = new Shape.Rectangle({
topLeft: topLeft,
bottomRight: bottomRight,
fillColor: gradientColor,
strokeScaling: true
});

var shape = new Shape.Rectangle({
topLeft: topLeft,
bottomRight: bottomRight,
fillColor: gradientColor,
strokeScaling: false
});

comparePixels(path, shape);

path.scale(2);
path.rotate(45);
shape.scale(2);
shape.rotate(45);

comparePixels(path, shape);
})

test('Modifying group.strokeColor for multiple children', function() {
var item = new Group(new Path(), new Path());
item.strokeColor = 'red';
Expand Down

0 comments on commit c9d1c88

Please sign in to comment.