Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/svg/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@ const svgText: SVGProxy<TSpan> = {
setTransform(textSvgEl, el.transform);

// Consider different font display differently in vertial align, we always
// set vertialAlign as 'middle', and use 'y' to locate text vertically.
// set verticalAlign as 'middle', and use 'y' to locate text vertically.
const x = style.x || 0;
const y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline);
const textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign as keyof typeof TEXT_ALIGN_TO_ANCHOR]
|| style.textAlign;

attr(textSvgEl, 'dominant-baseline', 'central');
attr(textSvgEl, 'dominant-baseline', style.textBaseline || 'central');
attr(textSvgEl, 'text-anchor', textAlign);
attr(textSvgEl, 'x', x + '');
attr(textSvgEl, 'y', y + '');
Expand Down