markers: don't fail for missing path
This commit is contained in:
@@ -1288,7 +1288,7 @@ function svgShapeToSVG(shape, fillColor, strokeColor, strokeWidth, scale) {
|
|||||||
let wi = shape.w * scale;
|
let wi = shape.w * scale;
|
||||||
let he = shape.h * scale;
|
let he = shape.h * scale;
|
||||||
|
|
||||||
if (!shape.path) {
|
if (shape.svg) {
|
||||||
let svg = shape.svg.replace('fillColor', fillColor).replace('strokeColor', strokeColor).replace('strokeWidth', strokeWidth);
|
let svg = shape.svg.replace('fillColor', fillColor).replace('strokeColor', strokeColor).replace('strokeWidth', strokeWidth);
|
||||||
svg = svg.replace('SIZE', 'width="' + wi + 'px" height="' + he + 'px"');
|
svg = svg.replace('SIZE', 'width="' + wi + 'px" height="' + he + 'px"');
|
||||||
return svg;
|
return svg;
|
||||||
@@ -1300,12 +1300,14 @@ function svgShapeToSVG(shape, fillColor, strokeColor, strokeWidth, scale) {
|
|||||||
+ 'width="' + wi + '" height="' + he + '">'
|
+ 'width="' + wi + '" height="' + he + '">'
|
||||||
+ '<g' + (shape.transform ? (' transform="' + shape.transform + '"') : '') + '>';
|
+ '<g' + (shape.transform ? (' transform="' + shape.transform + '"') : '') + '>';
|
||||||
|
|
||||||
let path = shape.path;
|
if (shape.path) {
|
||||||
if (! Array.isArray(path))
|
let path = shape.path;
|
||||||
path = [path];
|
if (! Array.isArray(path))
|
||||||
for (let i = 0; i < path.length; i++) {
|
path = [path];
|
||||||
svg += '<path paint-order="stroke" fill="' + fillColor + '" stroke="' + strokeColor + '" stroke-width="' + (2 * strokeWidth) + '" '
|
for (let i = 0; i < path.length; i++) {
|
||||||
+ 'd="' + path[i] + '"/>';
|
svg += '<path paint-order="stroke" fill="' + fillColor + '" stroke="' + strokeColor + '" stroke-width="' + (2 * strokeWidth) + '" '
|
||||||
|
+ 'd="' + path[i] + '"/>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shape.accent) {
|
if (shape.accent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user