[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix 1252 by compressing page (issue3422041)
From: |
Carl . D . Sorensen |
Subject: |
Fix 1252 by compressing page (issue3422041) |
Date: |
Thu, 02 Dec 2010 20:52:00 +0000 |
Reviewers: ,
Message:
Here's a patch to fix issue 1252 (music overflows page) by compressing
music together. It may cause collisions, but it should solve the
critical overflow error.
Description:
Fix 1252 by compressing page
Please review this at http://codereview.appspot.com/3422041/
Affected files:
M lily/page-layout-problem.cc
Index: lily/page-layout-problem.cc
diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc
index
1a39ad51e8c21f681d1d345424b1c30931820e57..aef52e2bfb5ac8a3d360fc24c77901cceac7ea6c
100644
--- a/lily/page-layout-problem.cc
+++ b/lily/page-layout-problem.cc
@@ -309,8 +309,16 @@ 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_));
+ {
+ double 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 (_f ("compressing music to fit"));
+ }
}
// The solution_ vector stores the position of every live VerticalAxisGroup
- Fix 1252 by compressing page (issue3422041),
Carl . D . Sorensen <=