lilypond-user
[Top][All Lists]
Advanced

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

Re: make-line-stencil


From: David Kastrup
Subject: Re: make-line-stencil
Date: Sun, 20 Dec 2015 09:44:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Andrew Bernard <address@hidden> writes:

> The make-line-stencil function appears to be hardwired to draw lines with 
> rounded ends. Is there any way it can be persuaded to make lines with square 
> ends?
>
> This is the code in stencil.scm:
>
> (define-public (make-line-stencil width startx starty endx endy)
>   "Make a line stencil of given linewidth and set its extents accordingly."
>   (let ((xext (cons (min startx endx) (max startx endx)))
>         (yext (cons (min starty endy) (max starty endy))))
>     (ly:make-stencil
>      (list 'draw-line width startx starty endx endy)
>      ;; Since the line has rounded edges, we have to / can safely add half the
>      ;; width to all coordinates!
>      (interval-widen xext (/ width 2))
>      (interval-widen yext (/ width 2)))))
>
> I suspect the answer is buried somewhere in the output drawing routines, but 
> so far my detective work has failed to uncover where.

You can follow the links in
<URL:http://www.lilypond.org/doc/v2.18/input/regression/collated-files.html#markup-path-linecap.ly>.

-- 
David Kastrup



reply via email to

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