From: Joe Neeman Date: Sun, 10 Feb 2008 11:26:46 +0000 (+0100) Subject: Slightly better extent-estimation for stems. X-Git-Tag: release/2.11.40-1~3^2~23 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0000bf354336882a1cb6d627570db840e5c05a27;p=lilypond.git Slightly better extent-estimation for stems. Particularly effects the spacing of grace notes (eg. in bug 571). --- diff --git a/lily/stem.cc b/lily/stem.cc index 6016eebbb4..31311f101d 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -241,6 +241,7 @@ Stem::pure_height (SCM smob, SCM start, SCM end) return ly_interval2scm (iv); Real ss = Staff_symbol_referencer::staff_space (me); + Real rad = Staff_symbol_referencer::staff_radius (me); if (!to_boolean (me->get_property ("cross-staff"))) { @@ -255,12 +256,15 @@ Stem::pure_height (SCM smob, SCM start, SCM end) if (!hp.is_empty ()) iv.translate (hp[dir] * ss / 2); - } - /* at a minimum, make the pure-height cover the staff symbol */ - Real rad = Staff_symbol_referencer::staff_radius (me); - iv.add_point (-rad * ss); - iv.add_point (rad * ss); + /* extend the stem (away from the head) to cover the staff */ + if (dir == UP) + iv[UP] = max (iv[UP], rad * ss); + else + iv[DOWN] = min (iv[DOWN], -rad * ss); + } + else + iv = Interval (-rad * ss, rad * ss); return ly_interval2scm (iv); }