Skip to content

Commit 1fedc25

Browse files
committed
fix #49
1 parent 0139e63 commit 1fedc25

9 files changed

+14
-8
lines changed

Diff for: dist/svg-path-commander.cjs

+1-1
Large diffs are not rendered by default.

Diff for: dist/svg-path-commander.cjs.map

+1-1
Large diffs are not rendered by default.

Diff for: dist/svg-path-commander.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/svg-path-commander.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/svg-path-commander.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ const D = (e) => {
608608
Dt(t);
609609
if (t != null && t.err.length)
610610
throw TypeError(t.err);
611-
return t.segments;
611+
return t.segments[0][0] = "M", t.segments;
612612
}, at = (e, t, s, r) => {
613613
const [n] = e, i = n.toUpperCase();
614614
if (t === 0 || i === n) return e;

Diff for: dist/svg-path-commander.mjs.map

+1-1
Large diffs are not rendered by default.

Diff for: docs/svg-path-commander.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: docs/svg-path-commander.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/parser/parsePathString.ts

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ const parsePathString = <T extends PathArray>(pathInput: string | T) => {
2727
throw TypeError(path.err);
2828
}
2929

30+
/**
31+
* force absolute first M
32+
* getPathBBox calculation requires first segment to be absolute
33+
* @see https://github.com/thednp/svg-path-commander/pull/49
34+
*/
35+
path.segments[0][0] = "M";
3036
return path.segments as PathArray;
3137
};
3238

0 commit comments

Comments
 (0)