From 0f3fefdfdf5fb73533fa63fdb975895a8d452845 Mon Sep 17 00:00:00 2001
From: Joe Neeman <joeneeman@gmail.com>
Date: Thu, 26 May 2011 21:45:18 +0300
Subject: [PATCH] Make BassFigureAlignment ignore alignment-distances.

---
 input/regression/page-spacing-bass-figures.ly | 19 +++++++++++++++++++
 lily/align-interface.cc                       |  7 +++++++
 2 files changed, 26 insertions(+)
 create mode 100644 input/regression/page-spacing-bass-figures.ly

diff --git a/input/regression/page-spacing-bass-figures.ly b/input/regression/page-spacing-bass-figures.ly
new file mode 100644
index 0000000000..8a3fef0e55
--- /dev/null
+++ b/input/regression/page-spacing-bass-figures.ly
@@ -0,0 +1,19 @@
+\version "2.15.0"
+
+\header {
+  texidoc = "@var{alignment-distances} applies to the toplevel
+VerticalAlignment but not to BassFigureAlignment.  The 4 in
+the bass figure line should be directly below the 6."
+}
+
+\score {
+ <<
+   \new Staff {
+     \overrideProperty #"Score.NonMusicalPaperColumn"
+     #'line-break-system-details #'((alignment-distances . (15)))
+     c'4
+   }
+   \new Staff <<
+     { d'4 }
+     \figures { <6 4>4 } >> >>
+ }
diff --git a/lily/align-interface.cc b/lily/align-interface.cc
index cb876f5bbf..5741a44272 100644
--- a/lily/align-interface.cc
+++ b/lily/align-interface.cc
@@ -182,6 +182,13 @@ Align_interface::internal_get_minimum_translations (Grob *me,
 {
   if (!pure && a == Y_AXIS && dynamic_cast<Spanner*> (me) && !me->get_system ())
     me->programming_error ("vertical alignment called before line-breaking");
+
+  // If include_fixed_spacing is true, we look at things like system-system-spacing
+  // and alignment-distances, which only make sense for the toplevel VerticalAlignment.
+  // If we aren't toplevel, we're working on something like BassFigureAlignment
+  // and so we definitely don't want to include alignment-distances!
+  if (!dynamic_cast<System*> (me->get_parent (Y_AXIS)))
+    include_fixed_spacing = false;
   
   Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
 					   DOWN);
-- 
2.39.5