mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-17 22:40:54 +02:00
adjusted renderElement
This commit is contained in:
@@ -985,6 +985,8 @@ export const renderElementToSvg = (
|
||||
renderConfig,
|
||||
);
|
||||
|
||||
const scaleX = element.scale?.[0] || 1;
|
||||
const scaleY = element.scale?.[1] || 1;
|
||||
// render embeddable element + iframe
|
||||
const embeddableNode = roughSVGDrawWithPrecision(
|
||||
rsvg,
|
||||
@@ -996,7 +998,7 @@ export const renderElementToSvg = (
|
||||
"transform",
|
||||
`translate(${offsetX || 0} ${
|
||||
offsetY || 0
|
||||
}) rotate(${degree} ${cx} ${cy})`,
|
||||
}) rotate(${degree} ${cx} ${cy}) scale(${scaleX}, ${scaleY})`,
|
||||
);
|
||||
while (embeddableNode.firstChild) {
|
||||
embeddableNode.removeChild(embeddableNode.firstChild);
|
||||
@@ -1027,8 +1029,8 @@ export const renderElementToSvg = (
|
||||
SVG_NS,
|
||||
"foreignObject",
|
||||
);
|
||||
foreignObject.style.width = `${element.width}px`;
|
||||
foreignObject.style.height = `${element.height}px`;
|
||||
foreignObject.style.width = `${element.width / scaleX}px`;
|
||||
foreignObject.style.height = `${element.height / scaleY}px`;
|
||||
foreignObject.style.border = "none";
|
||||
const div = foreignObject.ownerDocument!.createElementNS(SVG_NS, "div");
|
||||
div.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
||||
|
Reference in New Issue
Block a user