From 298a9feb39e18046044779a802a5a521ac939c09 Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Mon, 29 Aug 2011 11:11:49 +0200 Subject: [PATCH] Fixes a tuplet bracket bug caused by 32570e8ac85561afc1f59712301ee80c0d69d2b3. Tuplet bracket positions were being calculated before beamed stem positions were set. This patch triggers the setting of stem positions before the calculation of these brackets. --- lily/tuplet-bracket.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 67a00b4b2b..627d6fcfb0 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -556,14 +556,21 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy) Drul_array stems (Note_column::get_stem (columns[0]), Note_column::get_stem (columns.back ())); - Real lp = stems[LEFT]->extent (stems[LEFT], Y_AXIS)[get_grob_direction (stems[LEFT])] - + stems[LEFT]->get_parent (Y_AXIS)->relative_coordinate (commony, Y_AXIS); - Real rp = stems[RIGHT]->extent (stems[RIGHT], Y_AXIS)[get_grob_direction (stems[RIGHT])] - + stems[RIGHT]->get_parent (Y_AXIS)->relative_coordinate (commony, Y_AXIS); - - *dy = rp - lp; - points.push_back (Offset (stems[LEFT]->relative_coordinate (commonx, X_AXIS) - x0, lp)); - points.push_back (Offset (stems[RIGHT]->relative_coordinate (commonx, X_AXIS) - x0, rp)); + Interval poss; + Direction side = LEFT; + do + { + // Trigger setting of stem lengths if necessary. + if (Grob *beam = Stem::get_beam (stems[side])) + (void) beam->get_property ("quantized-positions"); + poss[side] = stems[side]->extent (stems[side], Y_AXIS)[get_grob_direction (stems[side])] + + stems[side]->get_parent (Y_AXIS)->relative_coordinate (commony, Y_AXIS); + } + while (flip (&side) != LEFT); + + *dy = poss[RIGHT] - poss[LEFT]; + points.push_back (Offset (stems[LEFT]->relative_coordinate (commonx, X_AXIS) - x0, poss[LEFT])); + points.push_back (Offset (stems[RIGHT]->relative_coordinate (commonx, X_AXIS) - x0, poss[RIGHT])); } else { -- 2.39.5