X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Foutput-lib.scm;h=292755e27e21a0ab7a76a8a008ce682164b9817e;hb=77706635f33adff837dc7af0482f51ff3f0f5cb1;hp=409e8c1f8816f6f82dc8a777b1cb917cbfa66e45;hpb=d59b3e4801e5832c86e9210724ac3d2ec4fef1be;p=lilypond.git diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 409e8c1f88..292755e27e 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -173,6 +173,55 @@ and duration-log @var{log}." letter))) radius X))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; clipping + +(define-public (make-rhythmic-location bar-num num den) + (cons + bar-num (ly:make-moment num den))) + +(define-public (rhythmic-location? a) + (and (pair? a) + (integer? (car a)) + (ly:moment? (cdr a)))) + +(define-public (make-graceless-rhythmic-location loc) + (make-rhythmic-location + (car loc) + (ly:moment-main-numerator (rhythmic-location-measure-position loc)) + (ly:moment-main-denominator (rhythmic-location-measure-position loc)))) + +(define-public rhythmic-location-measure-position cdr) +(define-public rhythmic-location-bar-number car) + +(define-public (rhythmic-location (car a) (car b)) #f) + (else + (ly:moment=? a b) + (rhythmic-location? a b) + (rhythmic-locationfile-string a) + (ly:format "~a.~a.~a" + (car a) + (ly:moment-main-numerator (cdr a)) + (ly:moment-main-denominator (cdr a)))) + +(define-public (rhythmic-location->string a) + (ly:format "bar ~a ~a" + (car a) + (ly:moment->string (cdr a)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; break visibility @@ -185,6 +234,10 @@ and duration-log @var{log}." (define-public center-visible #(#f #t #f)) (define-public end-of-line-visible #(#t #f #f)) (define-public all-invisible #(#f #f #f)) +(define-public (inherit-x-parent-visibility grob) + (let ((parent (ly:grob-parent grob X))) + (ly:grob-property parent 'break-visibility all-invisible))) + (define-public spanbar-begin-of-line-invisible #(#t #f #f)) @@ -810,18 +863,10 @@ between the two text elements." (define-public (system-start-text::calc-y-offset grob) (define (live-elements-list me) - (let* ((elements (ly:grob-object me 'elements)) - (elts-length (ly:grob-array-length elements)) - (live-elements '())) - - (let get-live ((len elts-length)) - (if (> len 0) - (let ((elt (ly:grob-array-ref elements (1- len)))) - - (if (grob::is-live? elt) - (set! live-elements (cons elt live-elements))) - (get-live (1- len))))) - live-elements)) + (let ((elements (ly:grob-object me 'elements))) + + (filter! grob::is-live? + (ly:grob-array->list elements)))) (let* ((left-bound (ly:spanner-bound grob LEFT)) (live-elts (live-elements-list grob))