Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1438)

Unified Diff: lily/page-layout-problem.cc

Issue 3422041: Fix 1252 by compressing page (Closed)
Patch Set: Add regression test Created 13 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « input/regression/page-overflow-compression.ly ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lily/page-layout-problem.cc
diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc
index 1a39ad51e8c21f681d1d345424b1c30931820e57..4f035d72794617ba3bd144f8cf187046392b41db 100644
--- a/lily/page-layout-problem.cc
+++ b/lily/page-layout-problem.cc
@@ -309,8 +309,15 @@ Page_layout_problem::solve_rod_spring_problem (bool ragged)
solution_ = spacer.spring_positions ();
if (!spacer.fits ())
- warning (_f ("couldn't fit music on page: overflow is %f",
- spacer.configuration_length(spacer.force()) - page_height_));
+ {
+ Real overflow = spacer.configuration_length (spacer.force ()) - page_height_;
+ vsize space_count = solution_.size ();
+ for (vsize i = 0; i < space_count; i++)
+ solution_[i] -= (i + 1) * overflow / space_count;
+ warning (_f ("couldn't fit music on page: overflow is %f",
+ overflow));
+ warning (_ ("compressing music to fit"));
+ }
}
// The solution_ vector stores the position of every live VerticalAxisGroup
« no previous file with comments | « input/regression/page-overflow-compression.ly ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b