[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trap pure-y-common spanning multiple staves; issue 3359 (issue 13013
From: |
k-ohara5a5a |
Subject: |
Re: Trap pure-y-common spanning multiple staves; issue 3359 (issue 13013046) |
Date: |
Tue, 27 Aug 2013 17:44:52 +0000 |
Reviewers: janek,
Message:
On 2013/08/27 07:59:59, janek wrote:
could you expand the commit message (or add a comment in
the source) to explain why we want this?
Good point.
I put that comment where the test might make more sense, if we can
figure out how to put it there with the new organization after the
unpure-pure-containers patch.
Description:
Trap pure-y-common spanning multiple staves; issue 3359
Please review this at https://codereview.appspot.com/13013046/
Affected files:
M lily/axis-group-interface.cc
Index: lily/axis-group-interface.cc
diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc
index
0d786c3a2959aa201470f761c27ee3cd6a98645d..90a9bfe695df903dc065a967d4881bde5e052fe8
100644
--- a/lily/axis-group-interface.cc
+++ b/lily/axis-group-interface.cc
@@ -487,6 +487,13 @@ SCM
Axis_group_interface::calc_pure_relevant_grobs (SCM smob)
{
Grob *me = unsmob_grob (smob);
+ /* TODO: Filter out elements that belong to a different Axis_group,
+ such as the tie in
+ << \new Staff=A { c'1~ \change Staff=B c'}
+ \new Staff=B { \clef bass R1 R } >>
+ because thier location relative to this Axis_group is not known before
+ page layout. For now, we need to trap this case in calc_pure_y_common.
+ */
return internal_calc_pure_relevant_grobs (me, "elements");
}
@@ -529,6 +536,12 @@ Axis_group_interface::calc_pure_y_common (SCM smob)
extract_grob_set (me, "pure-relevant-grobs", elts);
Grob *common = common_refpoint_of_array (elts, me, Y_AXIS);
+ if (common != me && Align_interface::has_interface (common))
+ {
+ me->programming_error("My pure_y_common is a VerticalAlignment,"
+ " which might contain several staves.");
+ common = me;
+ }
if (!common)
{
me->programming_error ("No common parent found in
calc_pure_y_common.");
@@ -882,7 +895,12 @@ Axis_group_interface::skyline_spacing (Grob *me)
Grob *x_common = common_refpoint_of_array (elements, me, X_AXIS);
Grob *y_common = common_refpoint_of_array (elements, me, Y_AXIS);
- assert (y_common == me);
+ if (y_common != me)
+ {
+ me->programming_error("Some of my vertical-skyline-elements"
+ " are outside my VerticalAxisGroup.");
+ y_common = me;
+ }
// A rider is a grob that is not outside-staff, but has an outside-staff
// ancestor. In that case, the rider gets moved along with its ancestor.