source file of the GNU LilyPond music typesetter
- (c) 2002--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 2002--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "music.hh"
#include "note-collision.hh"
#include "note-column.hh"
-#include "pitch.hh"
#include "pointer-group-interface.hh"
#include "skyline.hh"
#include "stream-event.hh"
}
}
+vector<Grob*>
+Accidental_placement::get_break_reminder_accidentals (vector<Grob*> const &elts, Grob *left)
+{
+ vector<Grob*> br;
+ vector<Grob*> ra;
+ vector<Grob*> ret;
+
+ if (dynamic_cast<Item *> (left)->break_status_dir () != RIGHT)
+ return vector<Grob*> ();
+
+ for (vsize i = 0; i < elts.size (); i++)
+ {
+ split_accidentals (elts[i], &br, &ra);
+ ret.insert (ret.end (), br.begin (), br.end ());
+ }
+ return ret;
+}
+
/*
Accidentals are special, because they appear and disappear after
ties at will.
vector_sort (heads, less<Grob*> ());
uniq (heads);
+
+ vector<Grob *> stems;
+ for (vsize i = 0; i < heads.size (); i++)
+ {
+ if (Grob *s = Rhythmic_head::get_stem (heads[i]))
+ stems.push_back (s);
+ }
+
+ vector_sort (stems, less<Grob*> ());
+ uniq (stems);
+
common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS);
+ common[Y_AXIS] = common_refpoint_of_array (stems, common[Y_AXIS], Y_AXIS);
+
+ for (vsize i = 0; i < heads.size (); i++)
+ {
+ if (Grob *s = Rhythmic_head::get_stem (heads[i]))
+ {
+ stems.push_back (s);
+ common[Y_AXIS] = s->common_refpoint (common[Y_AXIS], Y_AXIS);
+ }
+ }
+
+ vector_sort (stems, less<Grob*> ());
+ uniq (stems);
+
for (vsize i = apes.size (); i--;)
{
ape->extents_.insert (ape->extents_.end (), boxes.begin (), boxes.end ());
}
- ape->left_skyline_ = Skyline (ape->extents_, Y_AXIS, LEFT);
- ape->right_skyline_ = Skyline (ape->extents_, Y_AXIS, RIGHT);
+ ape->left_skyline_ = Skyline (ape->extents_, 0, Y_AXIS, LEFT);
+ ape->right_skyline_ = Skyline (ape->extents_, 0, Y_AXIS, RIGHT);
}
Interval total;
head_extents.push_back (Box (heads[i]->extent (common[X_AXIS], X_AXIS),
heads[i]->extent (common[Y_AXIS], Y_AXIS)));
- vector<Grob *> stems;
- for (vsize i = 0; i < heads.size (); i++)
- {
- if (Grob *s = Rhythmic_head::get_stem (heads[i]))
- stems.push_back (s);
- }
-
- vector_sort (stems, less<Grob*> ());
- uniq (stems);
for (vsize i = 0; i < stems.size (); i ++)
{
int very_large = INT_MAX;
- head_extents.push_back (Box (heads[i]->extent (common[X_AXIS], X_AXIS),
- heads[i]->pure_height (common[Y_AXIS], 0, very_large)));
+ head_extents.push_back (Box (stems[i]->extent (common[X_AXIS], X_AXIS),
+ stems[i]->pure_height (common[Y_AXIS], 0, very_large)));
}
- head_ape->left_skyline_ = Skyline (head_extents, Y_AXIS, LEFT);
+ head_ape->left_skyline_ = Skyline (head_extents, 0, Y_AXIS, LEFT);
head_ape->offset_ = 0.0;
Real padding = robust_scm2double (me->get_property ("padding"), 0.2);
Skyline left_skyline = head_ape->left_skyline_;
- left_skyline.raise (-robust_scm2double (me->get_property ("right-padding"), 0))
-;
+ left_skyline.raise (-robust_scm2double (me->get_property ("right-padding"), 0));
+
/*
Add accs entries right-to-left.
*/
{
Real offset = -apes[i]->right_skyline_.distance (left_skyline);
if (isinf (offset))
- offset = (i < apes.size () - 1) ? apes[i + 1]->offset_ : 0.0;
+ offset = (i + 1 < apes.size ()) ? apes[i + 1]->offset_ : 0.0;
else
offset -= padding;
me->flush_extent_cache (X_AXIS);
me->set_property ("X-extent", scm_width);
- for (vsize i = apes.size (); i--;)
- delete apes[i];
+ junk_pointers (apes);
+ delete head_ape;
+
return SCM_BOOL_T;
}