[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue 4274: Fix a cyclic dependency in Rest_collision (issue 193590043 b
From: |
nine . fierce . ballads |
Subject: |
Issue 4274: Fix a cyclic dependency in Rest_collision (issue 193590043 by address@hidden) |
Date: |
Tue, 27 Jan 2015 03:29:58 +0000 |
Reviewers: ,
Description:
Rest_collision::calc_positioning_done now uses the pure height of
rests because the height of certain rests depends on their position on
the staff, which Rest_collision is responsible for adjusting.
There are differences in regression test output that I can not yet
explain. The differences do not appear when I run lilypond by itself,
so I'm expecting to have to dig up the exact command the regtests run.
I'm posting this review anyway in hopes that a reviewer will recognize
the problem.
Please review this at https://codereview.appspot.com/193590043/
Affected files (+5, -5 lines):
M lily/rest-collision.cc
Index: lily/rest-collision.cc
diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc
index
7648f6d9a09825109e54f879442e3b3d1c2f2fca..c7c032eb399761f55aaa69181c06928f59747ad7
100644
--- a/lily/rest-collision.cc
+++ b/lily/rest-collision.cc
@@ -171,8 +171,8 @@ Rest_collision::calc_positioning_done (SCM smob)
common = common_refpoint_of_array (ordered_rests[UP], common,
Y_AXIS);
Real diff
- = (ordered_rests[DOWN].back ()->extent (common, Y_AXIS)[UP]
- - ordered_rests[UP].back ()->extent (common, Y_AXIS)[DOWN]) /
staff_space;
+ = (ordered_rests[DOWN].back ()->pure_height (common, 0, 0)[UP]
+ - ordered_rests[UP].back ()->pure_height (common, 0, 0)[DOWN])
/ staff_space;
if (diff > 0)
{
@@ -189,8 +189,8 @@ Rest_collision::calc_positioning_done (SCM smob)
{
for (vsize i = ordered_rests[d].size () - 1; i-- > 0;)
{
- Real last_y = ordered_rests[d][i + 1]->extent (common,
Y_AXIS)[d];
- Real y = ordered_rests[d][i]->extent (common, Y_AXIS)[-d];
+ Real last_y = ordered_rests[d][i + 1]->pure_height (common,
0, 0)[d];
+ Real y = ordered_rests[d][i]->pure_height (common, 0, 0)[-d];
Real diff = d * ((last_y - y) / staff_space);
if (diff > 0)
@@ -221,7 +221,7 @@ Rest_collision::calc_positioning_done (SCM smob)
continue;
Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
- Interval restdim = rest->extent (common, Y_AXIS);
+ Interval restdim = rest->pure_height (common, 0, 0);
if (restdim.is_empty ())
continue;
- Issue 4274: Fix a cyclic dependency in Rest_collision (issue 193590043 by address@hidden),
nine . fierce . ballads <=