2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "molecule.hh"
11 #include "paper-def.hh"
13 #include "staff-symbol-referencer.hh"
14 #include "directional-element-interface.hh"
22 Dots::after_line_breaking ()
24 SCM d= get_elt_property ("dot-count");
25 if (gh_number_p (d) && gh_scm2int (d))
27 if (!directional_element (this).get ())
28 directional_element (this).set (UP);
30 Staff_symbol_referencer_interface si (this);
31 int p = int (si.position_f ());
33 si.set_position (p + directional_element (this).get ());
37 MAKE_SCHEME_SCORE_ELEMENT_NON_DEFAULT_CALLBACKS(Dots);
40 Dots::scheme_molecule (SCM d)
42 Score_element *sc = unsmob_element (d);
43 Molecule mol (sc->lookup_l ()->blank (Box (Interval (0,0),
46 SCM c = sc->get_elt_property ("dot-count");
49 Molecule d = sc->lookup_l ()->afm_find (String ("dots-dot"));
51 Real dw = d.extent (X_AXIS).length ();
52 d.translate_axis (-dw, X_AXIS);
55 for (int i = gh_scm2int (c); i--; )
57 d.translate_axis (2*dw,X_AXIS);
61 return mol.create_scheme ();