From c9d1c8848908b20d472309d9498f3a6184e5405b Mon Sep 17 00:00:00 2001 From: adroitwhiz Date: Mon, 8 Jun 2020 20:56:43 -0400 Subject: [PATCH] Add test for strokeScaling gradients --- test/tests/Color.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/test/tests/Color.js b/test/tests/Color.js index 7dfabeaa55..a86ad50394 100644 --- a/test/tests/Color.js +++ b/test/tests/Color.js @@ -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';