source file of the GNU LilyPond music typesetter
- (c) 1996--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "note-column.hh"
#include "stem.hh"
#include "paper-column.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "warn.hh"
#include "slur-bezier-bow.hh"
#include "main.hh"
/*
Default position is on stem X, at stem end Y
*/
- Real stem_thickness =
- gh_scm2double (stem->get_grob_property ("thickness"))
- * stem->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+ Real stem_thickness = Stem::thickness (stem);
o += Offset (0.5 *
x_extent * (1 + Stem::get_direction (stem))
- ((dir + 1)/2) * stem_thickness
o[X_AXIS] -= 0.5 * stem_dir * x_extent;
if ((stem_dir == dir)
- && !stem->extent (stem, Y_AXIS).empty_b ())
+ && !stem->extent (stem, Y_AXIS).is_empty ())
{
o[Y_AXIS] = stem->extent (common[Y_AXIS], Y_AXIS)[dir];
}
/*
leave a gap: slur mustn't touch head/stem
*/
- o[Y_AXIS] += dir * gh_scm2double (me->get_grob_property ("y-free")) *
+ o[Y_AXIS] += dir * robust_scm2double (me->get_grob_property ("y-free"), 0) *
1.0;
return o;
}
Grob * me = unsmob_grob (smob);
assert (a == Y_AXIS);
- SCM mol = me->get_uncached_molecule ();
- return ly_interval2scm (unsmob_molecule (mol)->extent (a));
+ SCM mol = me->get_uncached_stencil ();
+ Interval ext;
+ if (Stencil * m = unsmob_stencil (mol))
+ ext = m->extent (a);
+ return ly_interval2scm (ext);
}
/*
Ugh should have dash-length + dash-period
*/
-MAKE_SCHEME_CALLBACK (Slur, brew_molecule,1);
+MAKE_SCHEME_CALLBACK (Slur, print,1);
SCM
-Slur::brew_molecule (SCM smob)
+Slur::print (SCM smob)
{
Grob * me = unsmob_grob (smob);
if (!scm_ilength (me->get_grob_property ("note-columns")))
return SCM_EOL;
}
- Real thick = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) *
- gh_scm2double (me->get_grob_property ("thickness"));
+ Real base_thick = robust_scm2double (me->get_grob_property ("thickness"), 1);
+ Real thick = base_thick * Staff_symbol_referencer::line_thickness (me);
+
+ Real ss = Staff_symbol_referencer::staff_space (me);
Bezier one = get_curve (me);
// get_curve may suicide
if (!scm_ilength (me->get_grob_property ("note-columns")))
return SCM_EOL;
- Molecule a;
+ Stencil a;
SCM d = me->get_grob_property ("dashed");
if (gh_number_p (d))
- a = Lookup::dashed_slur (one, thick, thick * gh_scm2double (d));
+ a = Lookup::dashed_slur (one, thick, thick * robust_scm2double (d, 0));
else
- a = Lookup::slur (one, get_grob_direction (me) * thick, thick);
+ a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0,
+ thick);
return a.smobbed_copy ();
}
SCM h_inf_scm = me->get_grob_property ("height-limit");
SCM r_0_scm = me->get_grob_property ("ratio");
- Real r_0 = gh_scm2double (r_0_scm);
+ Real r_0 = robust_scm2double (r_0_scm, 1);
Real h_inf = staff_space * gh_scm2double (h_inf_scm);
Slur_bezier_bow bb (get_encompass_offsets (me),