2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 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"
18 set_elt_property ("dot-count", gh_int2scm (0));
22 Dots::do_post_processing ()
24 SCM d
= get_elt_property ("dot-count");
25 if (!gh_number_p (d
) || !gh_scm2int (d
))
27 set_elt_property ("transparent", SCM_BOOL_T
);
33 if (!directional_element (this).get ())
34 directional_element (this).set (UP
);
36 Staff_symbol_referencer_interface
si (this);
37 int p
= int (si
.position_f ());
39 si
.set_position (p
+ directional_element (this).get ());
43 Dots::do_brew_molecule_p () const
45 Molecule
*out
= new Molecule
;
46 Molecule fill
= lookup_l ()->fill (Box (Interval (0,0),
48 out
->add_molecule (fill
);
50 Molecule d
= lookup_l ()->afm_find (String ("dots-dot"));
52 Real dw
= d
.dim_
[X_AXIS
].length ();
53 d
.translate_axis (-dw
, X_AXIS
);
56 for (int i
= gh_scm2int (get_elt_property ("dot-count")); i
--; )
58 d
.translate_axis (2*dw
,X_AXIS
);
59 out
->add_molecule (d
);