2 note-head-side.cc -- implement Note_head_side
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "note-head-side.hh"
13 Note_head_side::add_support (Item*head_l)
15 if (support_l_arr_.find_l(head_l))
17 support_l_arr_.push (head_l);
18 add_dependency (head_l);
22 Note_head_side::do_pre_processing ()
25 for (int i=0; i < support_l_arr_.size(); i++)
27 Graphical_element *common =
28 common_refpoint (support_l_arr_[i], X_AXIS);
29 Real x = support_l_arr_[i]->relative_coordinate (common, X_AXIS)
30 - relative_coordinate (common, X_AXIS);
32 x_int.unite (x + support_l_arr_[i]->extent (X_AXIS));
36 x_int = Interval(0,0);
38 translate_axis (-extent(X_AXIS)[-notehead_align_dir_] + x_int[notehead_align_dir_], X_AXIS);
42 Note_head_side::do_substitute_element_pointer (Score_element*o,Score_element*n)
44 if (Item* o_l = dynamic_cast <Item *> (o))
45 support_l_arr_.substitute (o_l,dynamic_cast <Item *> (n));
48 Note_head_side:: Note_head_side()
50 notehead_align_dir_ = LEFT;
53 Note_head_side::supported_b ()const
55 return support_l_arr_.size ();