From: Han-Wen Nienhuys Date: Tue, 13 Jun 2006 12:57:03 +0000 (+0000) Subject: * lily/stem.cc (calc_stem_end_position): calc quantized-positions X-Git-Tag: release/2.10.0-2~520 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9fd90743640cd1b51e50c8f27f4fb56680b491c3;p=lilypond.git * lily/stem.cc (calc_stem_end_position): calc quantized-positions for beamed case. * lily/note-spacing.cc (stem_dir_correction): don't inspect stem_end_position, but estimate instead. Backportme. * lily/lexer.ll: set version-seen? even if version is INVALID. Backportme. --- diff --git a/ChangeLog b/ChangeLog index b642a390cf..e500743052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,10 @@ 2006-06-13 Han-Wen Nienhuys + * lily/stem.cc (calc_stem_end_position): calc quantized-positions + for beamed case. + * lily/note-spacing.cc (stem_dir_correction): don't inspect - stem_end_position if correct_stem_dirs isn't set. Backportme. + stem_end_position, but estimate instead. Backportme. * lily/tuplet-bracket.cc (calc_positions): look at stem-end-position for tuplet bracket slope. Fixes sloped tuplet diff --git a/VERSION b/VERSION index 56bf762d10..b5382f429e 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=9 -PATCH_LEVEL=8 +PATCH_LEVEL=9 MY_PATCH_LEVEL= diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index cb68f6b2df..619cda9b4e 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -306,13 +306,13 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, stems_drul[d] = stem; beams_drul[d] = Stem::get_beam (stem); - Direction sd = get_grob_direction (stem); - if (stem_dirs[d] && stem_dirs[d] != sd) + Direction stem_dir = get_grob_direction (stem); + if (stem_dirs[d] && stem_dirs[d] != stem_dir) { correct_stem_dirs = false; continue; } - stem_dirs[d] = sd; + stem_dirs[d] = stem_dir; /* Correction doesn't seem appropriate when there is a large flag @@ -326,8 +326,14 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, if (correct_stem_dirs && !hp.is_empty ()) { - Real chord_start = hp[sd]; - Real stem_end = Stem::stem_end_position (stem); + Real chord_start = hp[stem_dir]; + + /* + can't look at stem-end-position, since that triggers + beam slope computations. + */ + Real stem_end = hp[stem_dir] + + stem_dir * robust_scm2double (stem->get_property ("length"), 7); stem_posns[d] = Interval (min (chord_start, stem_end), max (chord_start, stem_end)); diff --git a/lily/stem.cc b/lily/stem.cc index 8527a21553..4bfac0eb6e 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -260,7 +260,7 @@ Stem::calc_stem_end_position (SCM smob) if (!head_count (me)) return scm_from_double (0.0); - if (Grob *beam = unsmob_grob (me->get_object ("beam"))) + if (Grob *beam = get_beam (me)) { (void) beam->get_property ("quantized-positions"); return me->get_property ("stem-end-position"); @@ -684,6 +684,8 @@ SCM Stem::print (SCM smob) { Grob *me = unsmob_grob (smob); + Grob *beam = get_beam (me); + Stencil mol; Direction d = get_grob_direction (me); @@ -697,7 +699,6 @@ Stem::print (SCM smob) = to_boolean (me->get_property ("avoid-note-head")) ? last_head (me) : first_head (me); - Grob *beam = get_beam (me); if (!lh && !stemlet) return SCM_EOL;