From 5338a8ee0ca40b48b101487a880aaede91b6cff7 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 28 Jul 2002 10:37:28 +0000 Subject: [PATCH] * input/test/broken-spanner-adjustment.ly: new file. --- ChangeLog | 4 ++++ input/test/broken-spanner-adjustment.ly | 31 +++++++++++++++++++++++++ lily/grob-scheme.cc | 5 ++++ 3 files changed, 40 insertions(+) create mode 100644 input/test/broken-spanner-adjustment.ly diff --git a/ChangeLog b/ChangeLog index 8c08071bc5..41f707536c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-07-28 Han-Wen + + * input/test/broken-spanner-adjustment.ly: new file. + 2002-07-27 Mats Bengtsson * scripts/lilypond-book.py: Handle printfilename also together diff --git a/input/test/broken-spanner-adjustment.ly b/input/test/broken-spanner-adjustment.ly new file mode 100644 index 0000000000..cd9f206a86 --- /dev/null +++ b/input/test/broken-spanner-adjustment.ly @@ -0,0 +1,31 @@ +\header { + + texidoc = "Broken spanners can be adjusted individually, but +this requires complicated scheme code. + " + +} + +#(define (my-callback grob) + (let* ( + (o (get-original grob)) + (b (if (ly-grob? o) (get-broken-into o) '() )) + ) + + ;; Call the equivalent of Tie::after_line_breaking + ;; if you're using this for other grob-types. + + (if (and (>= (length b) 2) (eq? (car (last-pair b)) grob)) + (ly-set-grob-property! grob 'extra-offset '(4 . -2)) + ) + )) + +#(debug-enable 'backtrace) + +\score {\notes { + \property Voice.Tie \override #'after-line-breaking-callback = + #my-callback + c1\break ~ c2 ~ c +} + \paper { linewidth= 5.0 \cm } + } diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index 443938e763..0e42044ba7 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -136,6 +136,11 @@ Return the original Grob of @var{grob} /* ly prefix? spanner in name? */ +/* + TODO: maybe we should return a vector -- random access is more + logical for this list? + */ + LY_DEFINE (get_broken_into, "get-broken-into", 1, 0, 0, (SCM spanner), " -- 2.39.2