From 2bbce1a2f429eb0cd7dfb1f66faa8f29dcd633da Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 17 Jun 2006 21:53:22 +0000 Subject: [PATCH] * input/regression/tie-whole.ly: new file. * lily/tie-formatting-problem.cc (set_column_chord_outline): don't cross center of note head in case of invisible stem. --- ChangeLog | 7 +++++++ VERSION | 2 +- input/regression/tie-whole.ly | 16 ++++++++++++++++ lily/tie-formatting-problem.cc | 18 ++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 input/regression/tie-whole.ly diff --git a/ChangeLog b/ChangeLog index 35f0e4cafe..c592213f4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-17 Han-Wen Nienhuys + + * input/regression/tie-whole.ly: new file. + + * lily/tie-formatting-problem.cc (set_column_chord_outline): don't + cross center of note head in case of invisible stem. + 2006-06-16 Graham Percival * Documentation/user/ various: small fixes from mailist. diff --git a/VERSION b/VERSION index b5382f429e..4a595f5f0a 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=9 -PATCH_LEVEL=9 +PATCH_LEVEL=10 MY_PATCH_LEVEL= diff --git a/input/regression/tie-whole.ly b/input/regression/tie-whole.ly new file mode 100644 index 0000000000..dadba2be22 --- /dev/null +++ b/input/regression/tie-whole.ly @@ -0,0 +1,16 @@ +\header { + + texidoc = "For whole notes, the inside ties do not cross the center + of the note head, horizontally. " + + + } +\version "2.9.10" + +\paper { ragged-right = ##t } +\relative +{ + 1~ + 1~ + 1~ +} diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index f6d9675d64..1d42902a4f 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -163,6 +163,24 @@ Tie_formatting_problem::set_column_chord_outline (vector bounds, Y_AXIS, -dir); } } + else if (stem) + { + Grob *head = Stem::support_head (stem); + + /* + In case of invisible stem, don't pass x-center of heads. + */ + Real x_center = head->extent (x_refpoint_, X_AXIS).center (); + Interval x_ext; + x_ext[-dir] = x_center; + Interval y_ext; + for (vsize j = 0; j < head_boxes.size (); j++) + y_ext.unite (head_boxes[j][Y_AXIS]); + + insert_extent_into_skyline (&chord_outlines_[key], + Box (x_ext, y_ext), + Y_AXIS, -dir); + } Direction updowndir = DOWN; do -- 2.39.5