2004-07-18 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * scm/define-grobs.scm (all-grob-descriptions): set ratio
+ .25. This flattens short slurs.
+
+ * lily/new-slur.cc (enumerate_attachments): move X of attachment
+ points for tilted slurs.
+
+ * input/regression/slur-tilt.ly: new file.
+
+ * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): shorten
+ stems of 16th graces too.
+
* lily/beam-quanting.cc (score_forbidden_quants): make forbidden
quant penalty dependent on how much the line is in the gap.
&& Staff_symbol_referencer::on_staffline (head, (int) rint (pos))
&& Staff_symbol_referencer::line_count (head) -1 >= rint (pos)
)
- y += staff_space * dir / 10 ;
+ y += 1.5 * staff_space * dir / 10 ; // TODO: calc from slur thick & line thick, parameter.
Grob * fh = Note_column::first_head (extremes[d].note_column_);
x = fh->extent (common[X_AXIS], X_AXIS).linear_combination (CENTER);
Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me);
- Real r_0 = robust_scm2double (me->get_property ("ratio"), 1);
+ Real r_0 = robust_scm2double (me->get_property ("ratio"), 0.33);
Real h_inf = staff_space * ly_scm2double (me->get_property ("height-limit"));
for (int i = scores->size(); i-- ;)
{
{
Slur_score s;
Direction d = LEFT;
-
+
+ Drul_array<bool> attach_to_stem (false, false);
do {
os[d][X_AXIS] = base_attachment[d][X_AXIS];
{
os[d][X_AXIS] = extremes[d].slur_head_extent_[-d]
- d * 0.3;
+ attach_to_stem[d] = true;
}
else if (dir *extremes[d].stem_extent_[Y_AXIS][dir] < dir * os[d][Y_AXIS])
{
}
} while (flip (&d) != LEFT);
- Offset dz = os[RIGHT] - os[LEFT];
+
+
+
+ Offset dz;
+ dz = os[RIGHT] - os[LEFT];
if (dz[X_AXIS] < minimum_length
|| fabs (dz[Y_AXIS] / dz[X_AXIS]) > score_param->MAX_SLOPE
)
{
do {
if (extremes[d].slur_head_)
- os[d][X_AXIS] = extremes[d].slur_head_extent_.center ();
+ {
+ os[d][X_AXIS] = extremes[d].slur_head_extent_.center ();
+ attach_to_stem[d] = false;
+ }
} while (flip (&d) != LEFT);
}
+
+ dz = os[RIGHT] - os[LEFT];
+ do {
+ if (extremes[d].slur_head_
+ && !attach_to_stem[d])
+ {
+ /*
+ horizontally move tilted slurs a little. Move more
+ for bigger tilts.
+ */
+ os[d][X_AXIS] -=
+ dir * extremes[d].slur_head_extent_.length () * sin (dz.arg ()) / 3; // TODO: parameter
+ }
+ } while (flip (&d) != LEFT);
s.attachment_ = os;
scores.push (s);