Skip to content

Commit 4a83def

Browse files
committed
fix(ArcLabel): Support rotation in Canvas mode
1 parent 9247725 commit 4a83def

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'layerchart': patch
3+
---
4+
5+
fix(ArcLabel): Support rotation in Canvas mode
6+
7+
Changed `centroid-rotated` and `centroid-radial` placements to pass `rotate` prop instead of SVG `transform` string to `Text`, enabling rotation in Canvas rendering.

packages/layerchart/src/lib/components/ArcLabel.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
y: offsetCentroid[1],
223223
textAnchor: 'middle' as const,
224224
verticalAnchor: 'middle' as const,
225-
transform: `rotate(${centroidRotation}, ${offsetCentroid[0]}, ${offsetCentroid[1]})`,
225+
rotate: centroidRotation,
226226
};
227227
}
228228
return getArcTextProps?.('centroid', { startOffset, outerPadding }) ?? {};

0 commit comments

Comments
 (0)