2 g-staff-side.cc -- implement G_staff_side_item
4 source file of the GNU LilyPond music typesetter
6 (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "g-staff-side.hh"
13 G_staff_side_item::do_pre_processing ()
16 set_default_direction ();
20 G_staff_side_item::set_default_direction ()
25 G_staff_side_item::G_staff_side_item ()
29 transparent_b_ = true;
33 G_staff_side_item::set_victim (Score_element *e)
37 to_position_l_->dim_cache_[Y_AXIS].parent_l_ = &dim_cache_[Y_AXIS];
41 G_staff_side_item::add_support (Score_element*e)
44 support_l_arr_.push (e);
49 G_staff_side_item::do_substitute_dependency (Score_element*o, Score_element*n)
51 if (o == to_position_l_)
54 support_l_arr_.unordered_substitute (o,n);
59 G_staff_side_item::do_post_processing ()
61 if (!support_l_arr_.size ())
64 Dimension_cache *common = common_group (typecast_array (support_l_arr_, (Graphical_element*)0),
68 for (int i=0; i < support_l_arr_.size (); i++)
70 Score_element * e = support_l_arr_ [i];
71 Real coord = e->relative_coordinate (common, Y_AXIS);
72 dim.unite (coord + e->extent (Y_AXIS));
74 if (!support_l_arr_.size ())
77 Interval sym_dim = to_position_l_->extent (Y_AXIS);
78 Real off = dim_cache_[Y_AXIS].relative_coordinate (common);
80 dim_cache_[Y_AXIS].set_offset (dim[dir_] - sym_dim[-dir_] - off);