Skip to content

Commit

Permalink
Merge pull request #13498 from Snuffleupagus/issue-12996
Browse files Browse the repository at this point in the history
Normalize the coordinates used in `SVGGraphics._makeTilingPattern` (issue 12996)
  • Loading branch information
timvandermeij authored Jun 6, 2021
2 parents 1dd01b8 + 04ab4bd commit 7d83439
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/display/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,10 @@ if (
const paintType = args[7];

const tilingId = `shading${shadingCount++}`;
const [tx0, ty0] = Util.applyTransform([x0, y0], matrix);
const [tx1, ty1] = Util.applyTransform([x1, y1], matrix);
const [tx0, ty0, tx1, ty1] = Util.normalizeRect([
...Util.applyTransform([x0, y0], matrix),
...Util.applyTransform([x1, y1], matrix),
]);
const [xscale, yscale] = Util.singularValueDecompose2dScale(matrix);
const txstep = xstep * xscale;
const tystep = ystep * yscale;
Expand Down

0 comments on commit 7d83439

Please sign in to comment.