2002-07-23 Han-Wen <hanwen@cs.uu.nl>
+ * lily/separation-item.cc (width): cache extent in extent-X
+
+ * lily/spacing-spanner.cc (standard_breakable_column_spacing):
+ only add extent for non-musical column.
+
* lily/accidental-placement.cc (split_accidentals): new function
(get_relevant_accidental_extent): new function
--- /dev/null
+\header {
+texidoc = "Tied accidentaled notes (which cause reminder accidentals) don't wreak havoc in
+the spacing when unbroken."
+}
+
+\version "1.5.68"
+\include "deutsch.ly"
+
+rechts = \notes \relative c' {
+ \clef treble
+ \time 3/4
+ \context Voice {
+ c8 h2 <g8 h des f> ~ |
+ <g8 h des f>
+ }
+}
+
+Rechts = \context Staff \notes {
+ rechts
+}
+
+\score {
+ \rechts
+
+ \paper {
+ linewidth = -3.3 \cm
+ }
+}
}
/*
- Accidentals are special, because they appear and disappear before
- and after ties at will.
+ Accidentals are special, because they appear and disappear after
+ ties at will.
*/
Interval
Accidental_placement::get_relevant_accidental_extent (Grob *me,
{
/*
- This is an inner loop, however, in most cases, the interesting L
- will just be the first entry of NEXT, making it linear in most of
- the cases. */
+ This is an inner loop: look for the first normal (unbroken) Left
+ grob. This looks like an inner loop (ie. quadratic total), but in
+ most cases, the interesting L will just be the first entry of
+ NEXT, making it linear in most of the cases.
+ */
+ if (Separation_item::width (r).empty_b ())
+ return;
+
for(; gh_pair_p (next); next = ly_cdr (next))
{
Item *l = dynamic_cast<Item*> (unsmob_grob (ly_car( next)));
rod.item_l_drul_[RIGHT] = r;
rod.distance_f_ = li[RIGHT] - ri[LEFT];
-
- rod.columnize ();
rod.add_to_cols ();
}
}
rod.distance_f_ = li[RIGHT] - ri[LEFT];
- rod.columnize ();
rod.add_to_cols ();
-
break;
}
- else
- /*
- this grob doesn't cause a constraint. We look further until we
- find one that does. */
- ;
+
+ /*
+ this grob doesn't cause a constraint. We look further until we
+ find one that does.
+ */
+
}
}
Pointer_group_interface::add_grob (me, ly_symbol2scm ("conditional-elements"), e);
}
+/*
+ Return the width of ME given that we are considering the object on
+ the LEFT.
+ */
Interval
Separation_item::conditional_width (Grob * me, Grob * left)
{
Interval w = width (me);
-
+
Item *item = dynamic_cast<Item*> (me);
Paper_column * pc = item->column_l ();
#include "break-align-interface.hh"
#include "spacing-interface.hh"
-/*
- paper-column:
- */
class Spacing_spanner
{
public:
Real * fixed, Real * space,
Moment shortest)
{
+
*fixed = 0.0;
Direction d = LEFT;
Drul_array<Item*> cols(l,r);
do
{
- Interval lext = cols[d]->extent (cols [d], X_AXIS);
-
- *fixed += -d * lext[-d];
+ if (!Paper_column::musical_b (cols[d]))
+ {
+ /*
+ Tied accidentals over barlines cause problems, so lets see
+ what happens if we do this for non musical columns only.
+ */
+ Interval lext = cols[d]->extent (cols [d], X_AXIS);
+ *fixed += -d * lext[-d];
+ }
}
while (flip (&d) != LEFT);
-
+
if (l->breakable_b (l) && r->breakable_b(r))
{
Moment *dt = unsmob_moment (l->get_grob_property ("measure-length"));
*space = *fixed + get_duration_space (me, dt, shortest.main_part_, &dummy);
}
-
-
}
All visible, i.e. non-transparent, grobs have a callback to create a
Molecule. The callback should be a Scheme function taking one argument
(the grob) and returning a Molecule. Most molecule callbacks are
-written in C++, but you can also write them in Scheme. An examlily/lilypond/ple is
+written in C++, but you can also write them in Scheme. An example is
provided in @code{input/regression/molecule-hacking.ly}.
")