fix: position reference footer below content to prevent overlap (Closes #25)
The reference footer was anchored to a fixed position near the bottom margin, causing it to overlap with notes text on songs that had both notes and references (e.g., "Die Gedanken sind frei"). Changed renderReferenceFooter to use flow-based positioning from the current y-position after notes/metadata, ensuring the separator line, abbreviation headers, and page numbers always render below the preceding content without overlap. Also updated calculateFooterReservation and MeasurementEngine to match the simplified layout calculation, and added toc.highlight_column to the example songbook.yaml to demonstrate column highlighting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -91,11 +91,11 @@ class MeasurementEngine(
|
||||
}
|
||||
}
|
||||
|
||||
// Reference book footer: reserve space for abbreviation row + page number row + separator line
|
||||
// Reference book footer: gap + separator line + abbreviation row + page number row
|
||||
if (config.referenceBooks.isNotEmpty() && song.references.isNotEmpty()) {
|
||||
val metaLineHeight = fontMetrics.measureLineHeight(config.fonts.metadata, config.fonts.metadata.size)
|
||||
heightMm += 4f * 0.3528f // gap before footer (4pt converted to mm)
|
||||
heightMm += metaLineHeight * 1.4f * 2 // two rows (headers + numbers)
|
||||
heightMm += metaLineHeight * 0.5f // separator line gap
|
||||
}
|
||||
|
||||
val pageCount = if (heightMm <= contentHeightMm) 1 else 2
|
||||
|
||||
Reference in New Issue
Block a user