2009/8/9 Reinhold Kainhofer <[email protected]>:

> Yes, this seems to work. But if I set alignAboveContext, then staff-
> affinity=#DOWN should be automatically applied. After all, I'm already telling
> lilypond that this context should be above the staff, so the vertical layout
> engine should be smart enough to keep the lyrics line together with that 
> staff.

Sounds logical to me. :)

Attached is a simple fix which seems to work OK.

Regards,
Neil
From e5ff7b5fc4e1d647b5d07992d0441235bd8e3a2e Mon Sep 17 00:00:00 2001
From: Neil Puttock <[email protected]>
Date: Sun, 9 Aug 2009 20:23:27 +0100
Subject: [PATCH] Set staff-affinity automatically for alignAboveContext/alignBelowContext.

---
 lily/vertical-align-engraver.cc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc
index 14f6733..b90af74 100644
--- a/lily/vertical-align-engraver.cc
+++ b/lily/vertical-align-engraver.cc
@@ -140,11 +140,13 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i)
 	      if (arr[i] == before_grob)
 		{
 		  arr.insert (arr.begin () + i, added);
+		  added->set_property ("staff-affinity", scm_from_int (DOWN));
 		  break;
 		}
 	      else if (arr[i] == after_grob)
 		{
 		  arr.insert (arr.begin () + i + 1, added);
+		  added->set_property ("staff-affinity", scm_from_int (UP));
 		  break;
 		}
 	    }
-- 
1.6.0.4

_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to