Skip to content

Commit 4bdd192

Browse files
committed
Add test for strokeScaling gradients
1 parent d0a3320 commit 4bdd192

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/tests/Color.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,41 @@ test('Gradients with applyMatrix', function() {
306306
comparePixels(path, shape);
307307
});
308308

309+
test('Gradients with strokeScaling: false', function() {
310+
var topLeft = [100, 100];
311+
var bottomRight = [400, 400];
312+
var gradientColor = {
313+
gradient: {
314+
stops: ['yellow', 'red', 'blue']
315+
},
316+
origin: topLeft,
317+
destination: bottomRight
318+
}
319+
320+
var path = new Shape.Rectangle({
321+
topLeft: topLeft,
322+
bottomRight: bottomRight,
323+
fillColor: gradientColor,
324+
strokeScaling: true
325+
});
326+
327+
var shape = new Shape.Rectangle({
328+
topLeft: topLeft,
329+
bottomRight: bottomRight,
330+
fillColor: gradientColor,
331+
strokeScaling: false
332+
});
333+
334+
comparePixels(path, shape);
335+
336+
path.scale(2);
337+
path.rotate(45);
338+
shape.scale(2);
339+
shape.rotate(45);
340+
341+
comparePixels(path, shape);
342+
})
343+
309344
test('Modifying group.strokeColor for multiple children', function() {
310345
var item = new Group(new Path(), new Path());
311346
item.strokeColor = 'red';

0 commit comments

Comments
 (0)