Update renderElement.ts
This commit is contained in:
parent
d469fe26e2
commit
e225a86f9f
@ -238,7 +238,7 @@ const drawElementOnCanvas = (
|
|||||||
rc.draw(fillShape);
|
rc.draw(fillShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fillShape && element.customData?.strokeOptions?.hasOutline) {
|
if (element.customData?.strokeOptions?.hasOutline) {
|
||||||
context.lineWidth =
|
context.lineWidth =
|
||||||
element.strokeWidth *
|
element.strokeWidth *
|
||||||
(element.customData.strokeOptions.outlineWidth ?? 1);
|
(element.customData.strokeOptions.outlineWidth ?? 1);
|
||||||
@ -1195,16 +1195,20 @@ export const renderElementToSvg = (
|
|||||||
);
|
);
|
||||||
node.setAttribute("stroke", "none");
|
node.setAttribute("stroke", "none");
|
||||||
const path = svgRoot.ownerDocument!.createElementNS(SVG_NS, "path");
|
const path = svgRoot.ownerDocument!.createElementNS(SVG_NS, "path");
|
||||||
if (!shape && element.customData?.strokeOptions?.hasOutline) {
|
if (element.customData?.strokeOptions?.hasOutline) {
|
||||||
path.setAttribute("fill", element.backgroundColor);
|
node.setAttribute(
|
||||||
path.setAttribute("stroke", element.strokeColor);
|
|
||||||
path.setAttribute(
|
|
||||||
"stroke-width",
|
"stroke-width",
|
||||||
`${
|
`${
|
||||||
(element.strokeWidth / 5) *
|
element.strokeWidth *
|
||||||
element.customData.strokeOptions.outlineWidth ?? 1
|
(element.customData.strokeOptions.outlineWidth ?? 1)
|
||||||
}`,
|
}`,
|
||||||
);
|
);
|
||||||
|
const outline = svgRoot.ownerDocument!.createElementNS(SVG_NS, "path");
|
||||||
|
outline.setAttribute("fill", "none");
|
||||||
|
outline.setAttribute("stroke", element.strokeColor);
|
||||||
|
outline.setAttribute("d", getFreeDrawSvgPath(element));
|
||||||
|
node.appendChild(outline);
|
||||||
|
path.setAttribute("fill", element.backgroundColor);
|
||||||
} else {
|
} else {
|
||||||
path.setAttribute("fill", element.strokeColor);
|
path.setAttribute("fill", element.strokeColor);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user