X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Falign-interface.cc;h=d187326922ed0b8dede64c4d479f25c9faf2b68e;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=aee6dad7058411b187c9b7388cca059e3d92aec1;hpb=94345c6367d9e6a7dac6711cbb81845e8e889db5;p=lilypond.git diff --git a/lily/align-interface.cc b/lily/align-interface.cc index aee6dad705..d187326922 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2000--2012 Han-Wen Nienhuys + Copyright (C) 2000--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ MAKE_SCHEME_CALLBACK (Align_interface, align_to_minimum_distances, 1); SCM Align_interface::align_to_minimum_distances (SCM smob) { - Grob *me = unsmob_grob (smob); + Grob *me = Grob::unsmob (smob); me->set_property ("positioning-done", SCM_BOOL_T); @@ -52,7 +52,7 @@ MAKE_SCHEME_CALLBACK (Align_interface, align_to_ideal_distances, 1); SCM Align_interface::align_to_ideal_distances (SCM smob) { - Grob *me = unsmob_grob (smob); + Grob *me = Grob::unsmob (smob); me->set_property ("positioning-done", SCM_BOOL_T); @@ -212,9 +212,17 @@ Align_interface::internal_get_minimum_translations (Grob *me, Skyline_pair skyline = get_skylines (elems[j], a, other_common, pure, start, end); if (skyline.is_empty ()) - dy = 0.0; - else if (!last_nonempty_element) - dy = skyline[-stacking_dir].max_height () + padding; + { + translates.push_back (where); + continue; + } + + if (!last_nonempty_element) + { + dy = skyline[-stacking_dir].max_height () + padding; + for (vsize k = j; k-- > 0;) + translates[k] = stacking_dir * dy; + } else { SCM spec = Page_layout_problem::get_spacing_spec (last_nonempty_element, elems[j], pure, start, end); @@ -267,8 +275,7 @@ Align_interface::internal_get_minimum_translations (Grob *me, last_spaceable_element_pos = where; last_spaceable_skyline = down_skyline; } - if (!skyline.is_empty ()) - last_nonempty_element = elems[j]; + last_nonempty_element = elems[j]; } if (pure) @@ -346,11 +353,11 @@ void Align_interface::set_ordered (Grob *me) { SCM ga_scm = me->get_object ("elements"); - Grob_array *ga = unsmob_grob_array (ga_scm); + Grob_array *ga = Grob_array::unsmob (ga_scm); if (!ga) { ga_scm = Grob_array::make_array (); - ga = unsmob_grob_array (ga_scm); + ga = Grob_array::unsmob (ga_scm); me->set_object ("elements", ga_scm); } @@ -360,7 +367,7 @@ Align_interface::set_ordered (Grob *me) ADD_INTERFACE (Align_interface, "Order grobs from top to bottom, left to right, right to left" " or bottom to top. For vertical alignments of staves, the" - " @code{break-system-details} of the left" + " @code{line-break-system-details} of the left" " @rinternals{NonMusicalPaperColumn} may be set to tune" " vertical spacing.",