lilypond-devel
[Top][All Lists]
Advanced

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

Uses Y-offset for stem tremolos instead of translated stencil. (issue486


From: mtsolo
Subject: Uses Y-offset for stem tremolos instead of translated stencil. (issue4867043)
Date: Thu, 11 Aug 2011 11:16:07 +0000

Reviewers: ,

Message:
My summer of lily continues with this patch.  Currently, the pure height
function in stem tremolo leads to incorrect results, as without an
offset, it places every stem tremolo at the center of the staff for all
pure calculations.  This patch provides a conservative estimate for the
tremolo's offset and height in pure functions (with an exact estimate
when beam's are not involved).

If you want to see the pure height approximations in action, use:

\override StemTremolo #'stencil =
#(lambda (grob)
  (let ((y-ext (ly:stem-tremolo::pure-height grob 0 0))
        (p-y-off (ly:stem-tremolo::pure-calc-y-offset grob 0 0))
        (y-off (ly:stem-tremolo::calc-y-offset grob)))
  (ly:stencil-add (ly:stem-tremolo::print grob)
    (stencil-with-color (ly:stencil-translate-axis (make-line-stencil
0.2 0 (car y-ext) 0 (cdr y-ext)) (- p-y-off y-off) Y) red))))

Note that overriding the stencil like this wipes out the effect of the
pure functions (as the pure height function is chained to the print
function), but it will show how the estimates are made (try it in
input/regression/stem-tremolo.ly).

Passes regtests.

Cheers,
MS

Description:
Uses Y-offset for stem tremolos instead of translated stencil.

Please review this at http://codereview.appspot.com/4867043/

Affected files:
  M lily/beam.cc
  M lily/include/beam.hh
  M lily/include/stem-tremolo.hh
  M lily/include/stem.hh
  M lily/stem-tremolo.cc
  M lily/stem.cc
  M scm/define-grobs.scm





reply via email to

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