Generation

This commit is contained in:
khodowany
2026-09-30 01:38:16 -05:00
parent b1a7b44d7a
commit deaa0468a7
20 changed files with 417 additions and 198 deletions
+7
View File
@@ -33,6 +33,13 @@ def audit_layout(document: dict, layout: generator.engraving.types.LayoutDocumen
for source in item.sources:
primitives.setdefault(source, []).append(item)
for system in page.systems:
for role in ('staff', 'tab-staff'):
lines = [p for p in system.primitives if p.role == role]
if lines:
left = min(x for p in lines for x, _ in p.points)
right = max(x for p in lines for x, _ in p.points)
if abs(left - layout.style.margin_x - 1) > 0.01 or abs(right - (page.width - layout.style.margin_x - 1)) > 0.01:
raise generator.engraving.types.EngravingError('music systems must have consistent rendered staff widths')
if system.start != previous_end or system.end <= system.start:
raise generator.engraving.types.EngravingError('layout systems do not partition the score timeline')
previous_end = system.end