Skip to content

Commit

Permalink
Fix path optimisation with stroke-linecap round
Browse files Browse the repository at this point in the history
Ref #890
  • Loading branch information
TrySound committed Feb 28, 2021
1 parent 79dbb4b commit 7901588
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/convertPathData.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ exports.fn = function(item, params) {
}
hasMarkerMid = item.hasAttr('marker-mid');

var stroke = item.computedAttr('stroke'),
strokeLinecap = item.computedAttr('stroke');
hasStrokeLinecap = stroke && stroke != 'none' && strokeLinecap && strokeLinecap != 'butt';
const stroke = item.computedAttr('stroke');
const strokeLinecap = item.computedAttr('stroke-linecap');
// stroke-linecap may exist in inline styles which are not parsed for now
hasStrokeLinecap = item.hasAttr('style') ||
stroke && stroke != 'none' && strokeLinecap && strokeLinecap != 'butt';

var data = path2js(item);

Expand Down
4 changes: 4 additions & 0 deletions test/plugins/convertPathData.03.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7901588

Please sign in to comment.