From 8124af5050ceccc31c867af739d03ccc73fec4af Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Tue, 2 Dec 2008 01:36:51 +0100 Subject: [PATCH] Fix for bug #218 (if articulation is over the stem, it should be centered on it) --- scm/output-lib.scm | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index dcb1129..5593e84 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -669,4 +669,14 @@ centered, X==1 is at the right, X == -1 is at the left." (define-public (script-interface::calc-x-offset grob) (ly:grob-property grob 'positioning-done) - (ly:self-alignment-interface::centered-on-x-parent grob)) + (let* + ((note-head-grob (ly:grob-parent grob X)) + (stem-grob (ly:grob-object note-head-grob 'stem)) + (common-refp (ly:grob-common-refpoint grob stem-grob X)) + (dir1 (ly:grob-property grob 'direction)) + (dir2 (ly:grob-property stem-grob 'direction))) + ;; If articulation is over the stem, it should be + ;; centered on the latter instead of the note head + (if (equal? dir1 dir2) + (ly:grob-relative-coordinate stem-grob common-refp X) + (ly:self-alignment-interface::centered-on-x-parent grob)))) -- 1.5.4.3