Hi James,
a) How to decide which fix is "better"? (My guess that using floats
might pose the danger of rounding errors adding up until something bad
happens - probably only for huge chords comprising hundreds of notes,
but I'd tend to favor the solution with rounding.)
That question is above my pay-grade
I went with my "feeling" described earlier now, heartened by the
regtests showing no problems that I could spot.
b) Would anybody be willing to shepherd a patch through the review process?
Sure I can do that for you. 'Git format-patch master' if you would be so kind?
:)
Thanks much! See attached.
c) Does the situation warrant inclusion of a new regression test? (The
example in the bug report on
https://sourceforge.net/p/testlilyissues/issues/5303/ would be suitable
I think.)
Put one in - it's easier to ask for forgiveness than permission right?
I'm sorry - I didn't realize that this can be done by just adding a file
to input/regression. Done now.
Lukas
>From 36f2d4e768c1a14c668ab5d132099969796cc5fb Mon Sep 17 00:00:00 2001
From: Lukas-Fabian Moser <l...@gmx.de>
Date: Thu, 4 Jul 2019 16:18:50 +0200
Subject: [PATCH] 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)
+}
+
+
+{ <d' f' a'>2 \clef bass <f, a, c> }
+
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
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel