lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implements multiple-line non-cross-staff glissandi (issue4527086)


From: n . puttock
Subject: Re: Implements multiple-line non-cross-staff glissandi (issue4527086)
Date: Mon, 27 Jun 2011 21:26:59 +0000


http://codereview.appspot.com/4527086/diff/23001/scm/output-lib.scm
File scm/output-lib.scm (right):

http://codereview.appspot.com/4527086/diff/23001/scm/output-lib.scm#newcode798
scm/output-lib.scm:798: (define-public (glissando::before-line-breaking
grob)
add docstring inside function

http://codereview.appspot.com/4527086/diff/23001/scm/output-lib.scm#newcode799
scm/output-lib.scm:799: (define
(glissando::internal-before-line-breaking grob dir)
I think it would be nicer to junk this and use for-each, particularly
since you're reading bound-details three times (and extra-dy twice):

(define-public (glissando::before-line-breaking grob)
  (let ((bound-details (ly:grob-property grob 'bound-details))
        (extra-dy (ly:grob-property grob 'extra-dy 0.0)))

    (for-each (lambda (dir-sym)
                (let* ((details (assoc-get dir-sym bound-details))
                       (dir (if (eq? dir-sym 'left) LEFT RIGHT))
                       (bound (ly:spanner-bound grob dir))
                       (common-y (ly:grob-common-refpoint grob bound Y))
                       (y (+ (interval-center (ly:grob-extent bound
common-y Y))
                             (/ (* dir extra-dy)
                                2))))
                  (if (not (assoc-get 'Y details))
                      (set! bound-details (assoc-set! bound-details
dir-sym
                                                      (acons 'Y y
details))))))
              '(left right))

    (set! (ly:grob-property grob 'bound-details) bound-details)))

http://codereview.appspot.com/4527086/diff/23001/scm/output-lib.scm#newcode800
scm/output-lib.scm:800: (let* ((orig (ly:grob-original grob))
What's going on here? :)

http://codereview.appspot.com/4527086/diff/23001/scm/output-lib.scm#newcode806
scm/output-lib.scm:806: (ly:spanner-broken-into orig)))))
will always be empty since line breaking hasn't happened yet

http://codereview.appspot.com/4527086/diff/23001/scm/output-lib.scm#newcode821
scm/output-lib.scm:821: (assoc-set! bound-details 'left l)
(set! bound-details (assoc-set! bound-details 'left l))

is safer

http://codereview.appspot.com/4527086/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]