fix
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user