SCM
Hyphen_spanner::brew_molecule (SCM smob)
{
- Spanner * sp = dynamic_cast<Spanner*> (unsmob_element (smob));
+ Spanner * sp = dynamic_cast<Spanner*> (unsmob_grob (smob));
- Score_element * common = sp;
+ Grob * common = sp;
Direction d = LEFT;
do
{
do
{
- Real x = sp->get_bound (d)->relative_coordinate (common, X_AXIS);
- Interval ext = sp->get_bound (d)->extent (X_AXIS);
- bounds[d] = (x + ext[-d]);
+ bounds[d] = sp->get_bound (d)->extent (common, X_AXIS)[-d];
}
while (flip (&d) != LEFT);
-
-
- Real ss = sp->paper_l ()->get_var ("staffspace");
Real lt = sp->paper_l ()->get_var ("stafflinethickness");
- Real th = gh_scm2double (sp->get_elt_property ("thickness")) * lt ;
- Real h = gh_scm2double (sp->get_elt_property ("height")) * ss;
- Real l = gh_scm2double (sp->get_elt_property ("minimum-length")) * ss;
+ Real th = gh_scm2double (sp->get_grob_property ("thickness")) * lt ;
+ Real h = gh_scm2double (sp->get_grob_property ("height"));
+ Real l = gh_scm2double (sp->get_grob_property ("minimum-length"));
// The hyphen can exist in the word space of the left lyric ...
- SCM space = sp->get_bound (LEFT)->get_elt_property ("word-space");
+ SCM space = sp->get_bound (LEFT)->get_grob_property ("word-space");
if (gh_number_p (space))
{
- bounds[LEFT] -= gh_scm2double (space)*ss;
+ bounds[LEFT] -= gh_scm2double (space);
}
Real w = bounds.length ();
/* for length, use a geometric mean of the available space and some minimum
}
}
Box b (Interval (-l/2,l/2), Interval (h,h+th));
- Molecule mol (sp->lookup_l ()->filledbox (b));
+ Molecule mol (Lookup::filledbox (b));
mol.translate_axis (bounds.center ()
-sp->relative_coordinate (common, X_AXIS),
X_AXIS);
- return mol.create_scheme ();
+ return mol.smobbed_copy ();
}
void
-Hyphen_spanner::set_textitem (Direction d, Score_element* b)
+Hyphen_spanner::set_textitem (Direction d, Grob* b)
{
elt_l_->set_bound (d, b);
elt_l_->add_dependency (b);