Skip to content

Commit

Permalink
remove z in more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
KTibow committed Nov 5, 2023
1 parent 712215b commit c46ca56
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugins/convertPathData.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ exports.fn = (root, params) => {

data = filters(data, newParams, {
isSafeToUseZ,
maybeHasStroke,
maybeHasStrokeAndLinecap,
hasMarkerMid,
});
Expand Down Expand Up @@ -384,13 +383,13 @@ const convertToRelative = (pathData) => {
* @type {(
* path: PathDataItem[],
* params: InternalParams,
* aux: { isSafeToUseZ: boolean, maybeHasStroke: boolean, maybeHasStrokeAndLinecap: boolean, hasMarkerMid: boolean }
* aux: { isSafeToUseZ: boolean, maybeHasStrokeAndLinecap: boolean, hasMarkerMid: boolean }
* ) => PathDataItem[]}
*/
function filters(
path,
params,
{ isSafeToUseZ, maybeHasStroke, maybeHasStrokeAndLinecap, hasMarkerMid }
{ isSafeToUseZ, maybeHasStrokeAndLinecap, hasMarkerMid }
) {
var stringify = data2Path.bind(null, params),
relSubpoint = [0, 0],
Expand Down Expand Up @@ -840,7 +839,7 @@ function filters(
if (
(command === 'Z' || command === 'z') &&
params.removeUseless &&
!maybeHasStroke &&
isSafeToUseZ &&
// @ts-ignore
item.base[0] === item.coords[0] &&
// @ts-ignore
Expand Down

0 comments on commit c46ca56

Please sign in to comment.