Remove clipPathUnits attribute from clipPath

Removed setting of clipPathUnits attribute for clipPath element.
This commit is contained in:
zsviczian
2025-11-22 14:46:10 +01:00
committed by GitHub
parent 37882c66cb
commit a4006a4141

View File

@@ -541,7 +541,7 @@ const renderElementToSvg = (
"clipPath", "clipPath",
); );
clipPath.id = `image-clipPath-${element.id}`; clipPath.id = `image-clipPath-${element.id}`;
clipPath.setAttribute("clipPathUnits", "userSpaceOnUse");
const clipRect = svgRoot.ownerDocument!.createElementNS( const clipRect = svgRoot.ownerDocument!.createElementNS(
SVG_NS, SVG_NS,
"rect", "rect",
@@ -550,6 +550,10 @@ const renderElementToSvg = (
Math.min(element.width, element.height), Math.min(element.width, element.height),
element, element,
); );
const clipOffsetX = element.crop ? normalizedCropX : 0;
const clipOffsetY = element.crop ? normalizedCropY : 0;
clipRect.setAttribute("x", `${clipOffsetX}`);
clipRect.setAttribute("y", `${clipOffsetY}`);
clipRect.setAttribute("width", `${element.width}`); clipRect.setAttribute("width", `${element.width}`);
clipRect.setAttribute("height", `${element.height}`); clipRect.setAttribute("height", `${element.height}`);
clipRect.setAttribute("rx", `${radius}`); clipRect.setAttribute("rx", `${radius}`);