stem_end_position if correct_stem_dirs isn't set. Backportme.
2006-06-13 Han-Wen Nienhuys <hanwen@lilypond.org>
+ * lily/note-spacing.cc (stem_dir_correction): don't inspect
+ stem_end_position if correct_stem_dirs isn't set. Backportme.
+
* lily/tuplet-bracket.cc (calc_positions): look at
stem-end-position for tuplet bracket slope. Fixes sloped tuplet
brackets narrower than beams. Backportme.
sqx += sqr (x);
sxy += x*y;
}
- int N = input.size ();
+
+ int count = input.size ();
*coef = 0.0;
*offset = 0.;
- Real den = (N * sqx - sqr (sx));
- if (!N || !den)
+ Real den = (count * sqx - sqr (sx));
+ if (!count || !den)
{
programming_error ("minimise_least_squares (): Nothing to minimise");
*coef = 0.0;
- *offset = N ? sy / N : 0.0;
+ *offset = count ? sy / count : 0.0;
}
else
{
- *coef = (N *sxy - sx * sy) / den;
- *offset = (sy - (*coef) * sx) / N;
+ *coef = (count * sxy - sx * sy) / den;
+ *offset = (sy - (*coef) * sx) / count;
}
}
correct_stem_dirs = false;
Interval hp = Stem::head_positions (stem);
- if (!hp.is_empty ())
+ if (correct_stem_dirs
+ && !hp.is_empty ())
{
Real chord_start = hp[sd];
Real stem_end = Stem::stem_end_position (stem);
- stem_posns[d] = Interval (min (chord_start, stem_end), max (chord_start, stem_end));
+ stem_posns[d] = Interval (min (chord_start, stem_end),
+ max (chord_start, stem_end));
head_posns[d].unite (hp);
}
}
SCM
Stem::pure_height (SCM smob, SCM start, SCM end)
{
+ (void) start;
+ (void) end;
+
+
Grob *me = unsmob_grob (smob);
Real ss = Staff_symbol_referencer::staff_space (me);
Real len = scm_to_double (calc_length (smob)) * ss / 2;
if (!head_count (me))
return scm_from_double (0.0);
+ if (Grob *beam = unsmob_grob (me->get_object ("beam")))
+ {
+ (void) beam->get_property ("quantized-positions");
+ return me->get_property ("stem-end-position");
+ }
Real ss = Staff_symbol_referencer::staff_space (me);
int durlog = duration_log (me);