From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Mon, 19 Feb 2007 14:40:16 +0000 (+0100)
Subject: Fix #289.
X-Git-Tag: release/2.11.20-1~19
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=264d51268e3ba26d6fb8cff9e5ba3d7e08f9de77;p=lilypond.git

Fix #289.

Override graceSettings for \voiceOne, \voiceTwo.
---

diff --git a/input/regression/grace-direction-polyphony.ly b/input/regression/grace-direction-polyphony.ly
new file mode 100644
index 0000000000..924a58e0f9
--- /dev/null
+++ b/input/regression/grace-direction-polyphony.ly
@@ -0,0 +1,13 @@
+\header {
+
+  texidoc = "The @code{\voiceOne} setting is retained after
+finishing the grace section."
+
+}
+\version "2.10.19"
+
+\relative c''' {
+  \voiceOne
+  c4
+  \grace d8 c4
+}
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 0f8560c810..a69c7ad16f 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -592,6 +592,9 @@ AncientRemoveEmptyStaffContext = \context {
 %%
   figuredBassFormatter = #format-bass-figure
   metronomeMarkFormatter = #format-metronome-markup
+
+
+  %% See also make-voice-props-set
   graceSettings = #`(
     (Voice Stem direction ,UP)
     (Voice Stem font-size -3)
diff --git a/scm/music-functions.scm b/scm/music-functions.scm
index 1a1af41991..928eaf7169 100644
--- a/scm/music-functions.scm
+++ b/scm/music-functions.scm
@@ -351,6 +351,17 @@ i.e.  this is not an override"
 					     (if (odd? n) -1 1)))
 	 direction-polyphonic-grobs)
     (list
+     (make-property-set 'graceSettings
+			;; TODO: take this from voicedGraceSettings or similar.
+			'((Voice Stem font-size -3)
+			  (Voice NoteHead font-size -3)
+			  (Voice Dots font-size -3)
+			  (Voice Stem length-fraction 0.8)
+			  (Voice Stem no-stem-extend #t)
+			  (Voice Beam thickness 0.384)
+			  (Voice Beam length-fraction 0.8)
+			  (Voice Accidental font-size -4)))
+    
      (make-grob-property-set 'NoteColumn 'horizontal-shift (quotient n 2))
      (make-grob-property-set 'MultiMeasureRest 'staff-position (if (odd? n) -4 4)))))) 
 
@@ -359,8 +370,9 @@ i.e.  this is not an override"
    (append
     (map (lambda (x) (make-grob-property-revert x 'direction))
 	 direction-polyphonic-grobs)
-    (list (make-grob-property-revert 'NoteColumn 'horizontal-shift))
-    (list (make-grob-property-revert 'MultiMeasureRest 'staff-position)))))
+    (list (make-property-unset 'graceSettings)
+	  (make-grob-property-revert 'NoteColumn 'horizontal-shift)
+	  (make-grob-property-revert 'MultiMeasureRest 'staff-position)))))
 
 
 (define-safe-public (context-spec-music m context #:optional id)