This commit is contained in:
tapframe 2025-09-11 13:21:36 +05:30
parent 0ce7df60cc
commit b516fe74d3

View file

@ -109,8 +109,9 @@ export const CustomSubtitles: React.FC<CustomSubtitlesProps> = ({
const lineHeightPx = displayLineHeight;
const strokeWidth = Math.max(0.5, outlineWidth);
// Position text from bottom up - last line should be at svgHeight - small margin
const marginFromBottom = baseFontSize * 0.1; // tighter to bottom to match RN Text
const lastLineBaselineY = svgHeight - marginFromBottom;
// Add descender buffer so letters like y/g/p/q/j aren't clipped
const descenderBuffer = baseFontSize * 0.35 + (strokeWidth * 0.5);
const lastLineBaselineY = svgHeight - descenderBuffer;
const startY = lastLineBaselineY - (lines.length - 1) * lineHeightPx;
return (
<>