>From 36f2d4e768c1a14c668ab5d132099969796cc5fb Mon Sep 17 00:00:00 2001 From: Lukas-Fabian Moser Date: Thu, 4 Jul 2019 16:18:50 +0200 Subject: [PATCH 1/2] In loop calculating the attachments of chord node heads to stem, calculate last used position by _rounding_ to int rather than by truncating to int. This fixes issue 5303 (misplaced note head bug). Also add regression test. --- input/regression/misplaced-note-head-bug.ly | 15 +++++++++++++++ lily/stem.cc | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 input/regression/misplaced-note-head-bug.ly diff --git a/input/regression/misplaced-note-head-bug.ly b/input/regression/misplaced-note-head-bug.ly new file mode 100644 index 0000000000..2a645f2a57 --- /dev/null +++ b/input/regression/misplaced-note-head-bug.ly @@ -0,0 +1,15 @@ +\version "2.19.16" + +\header { + + texidoc = "Misplaced note head bug (issue 5303) should be fixed." + +} + +\layout { + #(layout-set-staff-size 19) +} + + +{ 2 \clef bass } + diff --git a/lily/stem.cc b/lily/stem.cc index 37aa40c250..34bf557fca 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -626,7 +626,7 @@ Stem::calc_positioning_done (SCM smob) else parity = true; - lastpos = int (p); + lastpos = int (round (p)); } return SCM_BOOL_T; -- 2.17.1