Skip to content

Commit 1fedc25

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

9 files changed

+14
-8
lines changed

dist/svg-path-commander.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/svg-path-commander.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/svg-path-commander.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/svg-path-commander.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/svg-path-commander.mjs

Lines changed: 1 addition & 1 deletion
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;

dist/svg-path-commander.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/svg-path-commander.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/svg-path-commander.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parser/parsePathString.ts

Lines changed: 6 additions & 0 deletions
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)