2 vertical-align-grav.cc -- implement Vertical_align_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "vertical-align-grav.hh"
11 #include "vertical-align-spanner.hh"
12 #include "vertical-group-elem.hh"
14 Vertical_align_engraver::Vertical_align_engraver()
20 Vertical_align_engraver::do_creation_processing()
22 valign_p_
=new Vertical_align_spanner
;
23 valign_p_
->set_bounds(LEFT
,get_staff_info().command_pcol_l ());
24 announce_element (Score_elem_info (valign_p_
, 0));
28 Vertical_align_engraver::do_removal_processing()
30 valign_p_
->set_bounds(RIGHT
,get_staff_info().command_pcol_l ());
31 typeset_element (valign_p_
);
36 Vertical_align_engraver::acknowledge_element (Score_elem_info i
)
38 if (i
.origin_grav_l_arr_
.size() == 2 &&
39 i
.elem_l_
->is_type_b (Vertical_group_element::static_name()) &&
40 !i
.elem_l_
->axis_group_l_a_
[Y_AXIS
])
42 assert (!valign_p_
->contains_b (i
.elem_l_
));
44 valign_p_
->add (i
.elem_l_
);
49 IMPLEMENT_IS_TYPE_B1(Vertical_align_engraver
, Engraver
);
50 ADD_THIS_TRANSLATOR(Vertical_align_engraver
);