From a4006a4141c5ccea5c8a7e46037b099635389621 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Sat, 22 Nov 2025 14:46:10 +0100 Subject: [PATCH] Remove clipPathUnits attribute from clipPath Removed setting of clipPathUnits attribute for clipPath element. --- packages/excalidraw/renderer/staticSvgScene.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/excalidraw/renderer/staticSvgScene.ts b/packages/excalidraw/renderer/staticSvgScene.ts index 89af1dc724..2983112499 100644 --- a/packages/excalidraw/renderer/staticSvgScene.ts +++ b/packages/excalidraw/renderer/staticSvgScene.ts @@ -541,7 +541,7 @@ const renderElementToSvg = ( "clipPath", ); clipPath.id = `image-clipPath-${element.id}`; - + clipPath.setAttribute("clipPathUnits", "userSpaceOnUse"); const clipRect = svgRoot.ownerDocument!.createElementNS( SVG_NS, "rect", @@ -550,6 +550,10 @@ const renderElementToSvg = ( Math.min(element.width, element.height), 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("height", `${element.height}`); clipRect.setAttribute("rx", `${radius}`);