From: Mike Solomon Date: Mon, 22 Aug 2011 06:36:46 +0000 (+0200) Subject: Fixes Issue 40. X-Git-Tag: release/2.15.9-1~9^2~24^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b3c0b773bde05b3971f087ed6c5f4fb40a1b20b1;p=lilypond.git Fixes Issue 40. Adds an end-on-accidental bool in the details property of glissandi that is used in line spanner bound calculations. --- diff --git a/input/regression/glissando-accidental.ly b/input/regression/glissando-accidental.ly new file mode 100644 index 0000000000..1e15196b5d --- /dev/null +++ b/input/regression/glissando-accidental.ly @@ -0,0 +1,9 @@ +\header { + texidoc = "Glissandi stop before hitting accidentals." + +} +\version "2.15.9" + +\relative c'' { + a1\glissando cis +} diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 962f772a50..8cdc16b94f 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -24,6 +24,7 @@ #include "item.hh" #include "lily-proto.hh" #include "line-interface.hh" +#include "note-column.hh" #include "output-def.hh" #include "paper-column.hh" #include "pointer-group-interface.hh" @@ -109,12 +110,16 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir) ? columns[0] : columns.back (); } - Interval extent = (Paper_column::has_interface (bound_grob) - ? Axis_group_interface::generic_bound_extent (bound_grob, commonx, X_AXIS) - : robust_relative_extent (bound_grob, commonx, X_AXIS)); + Real x_coord = (Paper_column::has_interface (bound_grob) + ? Axis_group_interface::generic_bound_extent (bound_grob, commonx, X_AXIS) + : robust_relative_extent (bound_grob, commonx, X_AXIS)).linear_combination (attach); + + Grob *acc = Note_column::accidentals (bound_grob->get_parent (X_AXIS)); + if (acc && to_boolean (ly_assoc_get (ly_symbol2scm ("end-on-accidental"), details, SCM_BOOL_F))) + x_coord = robust_relative_extent (acc, commonx, X_AXIS).linear_combination (attach); details = scm_acons (ly_symbol2scm ("X"), - scm_from_double (extent.linear_combination (attach)), + scm_from_double (x_coord), details); } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 2dbaa4c2e7..e1d076c296 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -930,11 +930,12 @@ (Glissando . ( (after-line-breaking . ,ly:spanner::kill-zero-spanned-time) - (bound-details . ((right . ((attach-dir . ,CENTER) - (padding . 1.5) + (bound-details . ((right . ((attach-dir . ,LEFT) + (end-on-accidental . #t) + (padding . 0.5) )) - (left . ((attach-dir . ,CENTER) - (padding . 1.5) + (left . ((attach-dir . ,RIGHT) + (padding . 0.5) )) )) (gap . 0.5)