]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 660: ossia staff doesn't stop at correct horizontal position
authorDavid Kastrup <dak@gnu.org>
Fri, 3 Oct 2014 23:12:55 +0000 (01:12 +0200)
committerDavid Kastrup <dak@gnu.org>
Wed, 15 Oct 2014 05:46:04 +0000 (07:46 +0200)
lily/staff-symbol.cc
scm/define-grobs.scm

index a5db48de46887a1e44527fb0ce13551a1c683d65..e2c199633a1933246ab5ed3a94d2cac7ae4d3ef5 100644 (file)
@@ -65,11 +65,19 @@ Staff_symbol::print (SCM smob)
       else
         {
           Item *x = sp->get_bound (d);
-
-          span_points[d] = ((!x->break_status_dir ()
-                             && !x->extent (x, X_AXIS).is_empty ())
-                            ? Paper_column::break_align_width (x, ly_symbol2scm ("break-alignment"))[d]
-                            : x->relative_coordinate (common, X_AXIS));
+          if (x->extent (x, X_AXIS).is_empty ()
+              || (x->break_status_dir () && sp->broken_neighbor (d)))
+            span_points[d] = x->relative_coordinate (common, X_AXIS);
+          // What the default implementation of to-barline does for
+          // spanners is not really in usefully recognizable shape by
+          // now, so we just reimplement.
+          else
+            {
+              SCM where = (d == RIGHT
+                           ? me->get_property ("break-align-symbols")
+                           : ly_symbol2scm ("break-alignment"));
+              span_points[d] = Paper_column::break_align_width (x, where)[d];
+            }
         }
 
       span_points[d] -= d * t / 2;
@@ -372,6 +380,7 @@ ADD_INTERFACE (Staff_symbol,
                " @code{width} property.",
 
                /* properties */
+               "break-align-symbols "
                "ledger-extra "
                "ledger-line-thickness "
                "ledger-positions "
index 65063d7af5deeb8ef8482bbef01fa3c72b2fb1ac..de745d5f5ad065012af902e988f72e81b038d60a 100644 (file)
 
     (StaffSymbol
      . (
+        (break-align-symbols . (staff-bar break-alignment))
         (layer . 0)
         (ledger-line-thickness . (1.0 . 0.1))
         (line-count . 5)