Skip to content

AI-native design editor. Open-source Figma alternative.

fix(canvas): clip inside stroke geometry

Danila Poyarkov5f33f26756ff
diff --git a/packages/core/src/canvas/scene.ts b/packages/core/src/canvas/scene.ts
index 3d822b99d..f77cb351e 100644
--- a/packages/core/src/canvas/scene.ts
+++ b/packages/core/src/canvas/scene.ts
@@ -398,7 +398,14 @@ export function renderShapeUncached(
const sc = r.resolveStrokeColor(stroke, si, node, graph)
if (sg) {
- drawVectorStrokeGeometry(r, canvas, sg, sc, stroke.opacity)
+ if (node.type !== 'VECTOR' && stroke.align === 'INSIDE') {
+ canvas.save()
+ r.clipNodeShape(canvas, node, rect, hasRadius)
+ drawVectorStrokeGeometry(r, canvas, sg, sc, stroke.opacity)
+ canvas.restore()
+ } else {
+ drawVectorStrokeGeometry(r, canvas, sg, sc, stroke.opacity)
+ }
continue
}
if (vectorPaths) {