X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fbar-line.scm;h=3fad8f8912949bf96a9944b6a1019432be850cb3;hb=acae40c266a7df9b4882f937c733745c803ac9e4;hp=02c80f64e535810ede4a6a7d7cc5df8f01ea1154;hpb=c054eb280fd9953596eb164f67b0f9d5555c5a32;p=lilypond.git diff --git a/scm/bar-line.scm b/scm/bar-line.scm index 02c80f64e5..3fad8f8912 100644 --- a/scm/bar-line.scm +++ b/scm/bar-line.scm @@ -27,7 +27,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; helper functions for staff and layout properties -(define (calc-blot thickness extent grob) +(define (bar-line::calc-blot thickness extent grob) "Calculate the blot diameter by taking @code{'rounded} and the dimensions of the extent into account." (let* ((rounded (ly:grob-property grob 'rounded #f)) @@ -39,9 +39,18 @@ and the dimensions of the extent into account." ((< height blot-diameter) height) (else blot-diameter))) 0))) - blot)) +(define-public (bar-line::draw-filled-box x-ext y-ext thickness extent grob) + "Return a straight bar-line created by @code{ly:round-filled-box} looking at +@var{x-ext}, @var{y-ext}, @var{thickness}. The blot is calculated by +@code{bar-line::calc-blot}, which needs @var{extent} and @var{grob}. +@var{y-ext} is not necessarily of same value as @var{extent}." + (ly:round-filled-box + x-ext + y-ext + (bar-line::calc-blot thickness extent grob))) + (define (get-span-glyph bar-glyph) "Get the corresponding span glyph from the @code{span-glyph-bar-alist}. Pad the string with @code{annotation-char}s to the length of the @@ -250,35 +259,38 @@ is not used within the routine." (let* ((line-thickness (layout-line-thickness grob)) (thickness (* (ly:grob-property grob 'hair-thickness 1) line-thickness)) - (blot (calc-blot thickness extent grob)) (extent (bar-line::widen-bar-extent-on-span grob extent))) - - (ly:round-filled-box (cons 0 thickness) - extent - blot))) + (bar-line::draw-filled-box + (cons 0 thickness) + extent + thickness + extent + grob))) (define (make-thick-bar-line grob extent) "Draw a thick bar line." (let* ((line-thickness (layout-line-thickness grob)) (thickness (* (ly:grob-property grob 'thick-thickness 1) line-thickness)) - (blot (calc-blot thickness extent grob)) (extent (bar-line::widen-bar-extent-on-span grob extent))) - - (ly:round-filled-box (cons 0 thickness) - extent - blot))) + (bar-line::draw-filled-box + (cons 0 thickness) + extent + thickness + extent + grob))) (define (make-tick-bar-line grob extent) "Draw a tick bar line." (let* ((half-staff (* 1/2 (ly:staff-symbol-staff-space grob))) (staff-line-thickness (ly:staff-symbol-line-thickness grob)) - (height (interval-end extent)) - (blot (calc-blot staff-line-thickness extent grob))) - - (ly:round-filled-box (cons 0 staff-line-thickness) - (cons (- height half-staff) (+ height half-staff)) - blot))) + (height (interval-end extent))) + (bar-line::draw-filled-box + (cons 0 staff-line-thickness) + (cons (- height half-staff) (+ height half-staff)) + staff-line-thickness + extent + grob))) (define (make-colon-bar-line grob extent) "Draw repeat dots." @@ -467,11 +479,11 @@ draws the span bar variant, i.e. without the segno sign." (define (make-kievan-bar-line grob extent) "Draw a kievan bar line." (let* ((font (ly:grob-default-font grob)) - (stencil (stencil-whiteout + (stencil (stencil-whiteout-box (ly:font-get-glyph font "scripts.barline.kievan")))) ;; the kievan bar line has no staff lines underneath, - ;; so we whiteout them and move the grob to a higher layer + ;; so we whiteout-box them and move the grob to a higher layer (ly:grob-set-property! grob 'layer 1) stencil)) @@ -500,7 +512,7 @@ opening bracket will be drawn, for @code{RIGHT} we get the closing bracket." (interval-start extent) Y)))) - (if (eq? dir LEFT) + (if (eqv? dir LEFT) stencil (ly:stencil-scale stencil -1 1))))