This commit is contained in:
saqib mir
2026-07-31 17:53:41 +05:30
parent c75ae3ca08
commit 5aa352f181
+6 -4
View File
@@ -602,8 +602,10 @@ export const ParagraphEditor: React.FC<ParagraphEditorProps> = ({
}
const lineH = (para?.lines ?? []).reduce((m: number, ln: any) => Math.max(m, ln?.h ?? 0), 0);
if (!isFinite(minX)) {
return { x: layout.columnLeft, y: bl - domSize * 0.8, w: Math.max(0, columnRight - layout.columnLeft),
h: lineH || domSize * 1.2, ascent: domSize * 0.8, descent: domSize * 0.2, lineHeight: lineH || domSize * 1.2 };
return {
x: layout.columnLeft, y: bl - domSize * 0.8, w: Math.max(0, columnRight - layout.columnLeft),
h: lineH || domSize * 1.2, ascent: domSize * 0.8, descent: domSize * 0.2, lineHeight: lineH || domSize * 1.2
};
}
return {
x: minX, y: minY, w: maxX - minX, h: maxY - minY,
@@ -961,8 +963,8 @@ export const ParagraphEditor: React.FC<ParagraphEditorProps> = ({
// Preserve PDF hard line breaks (not a single CSS-wrapped flow).
const lineFrags = layout.origLines.length
? layout.origLines.map((l) => l.frags.map((f) => ({
text: f.text, fid: f.fid, size: f.size, color: f.color, fontName: domFontName, advances: f.advances,
})))
text: f.text, fid: f.fid, size: f.size, color: f.color, fontName: domFontName, advances: f.advances,
})))
: [layout.seedRuns];
lineFrags.forEach((frags, li) => {
if (li > 0) el.appendChild(document.createElement('br'));