From: Thomas Morley Date: Tue, 25 Oct 2016 20:29:20 +0000 (+0200) Subject: Issue 4988 straight-flags partly wrong calculated X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=3ad118d6062153701ab613c1b3855911c45214d3;p=lilypond.git Issue 4988 straight-flags partly wrong calculated The angles for straight-flags at down- and up-pointing stems are now accurately respected. This will cause some slight changes in the reg-tests. Also fixing flat-flags, which relied on the old, buggy calculation. Also doing the same fixes for markup-command note-by-number. Also fixing an oversight in regtest metronome-mark-formatter.ly, where the creation of the metronome-markup depends on note-by-number. --- diff --git a/input/regression/metronome-mark-formatter.ly b/input/regression/metronome-mark-formatter.ly index a288c91ced..841f6c40bb 100644 --- a/input/regression/metronome-mark-formatter.ly +++ b/input/regression/metronome-mark-formatter.ly @@ -108,6 +108,7 @@ mus = \context { \Score \override MetronomeMark.style = #'mensural + \override MetronomeMark.flag-style = #'mensural } } } diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 9ed4f9cc83..07f1538aa2 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -3701,17 +3701,18 @@ mensural-flags. Both are supplied for convenience. (raw-length (if stem-up upflag-length downflag-length)) (angle (if stem-up upflag-angle downflag-angle)) (flag-length (+ (* raw-length factor) half-stem-thickness)) - (flag-end (if (= angle 0) - (cons flag-length (* half-stem-thickness dir)) - (polar->rectangular flag-length angle))) + (flag-end (polar->rectangular flag-length angle)) (thickness (* flag-thickness factor)) (thickness-offset (cons 0 (* -1 thickness dir))) (spacing (* -1 flag-spacing factor dir)) (start (cons (- half-stem-thickness) (* half-stem-thickness dir))) - (points (list start - flag-end - (offset-add flag-end thickness-offset) - (offset-add start thickness-offset))) + (raw-points + (list + '(0 . 0) + flag-end + (offset-add flag-end thickness-offset) + thickness-offset)) + (points (map (lambda (coord) (offset-add coord start)) raw-points)) (stencil (ly:round-filled-polygon points half-stem-thickness)) ;; Log for 1/8 is 3, so we need to subtract 3 (flag-stencil (buildflags stencil (- log 3) stencil spacing))) diff --git a/scm/flag-styles.scm b/scm/flag-styles.scm index 2b52f44cb2..a2ddf3a9dd 100644 --- a/scm/flag-styles.scm +++ b/scm/flag-styles.scm @@ -81,19 +81,18 @@ All lengths are scaled according to the font size of the note." (raw-length (if stem-up upflag-length downflag-length)) (angle (if stem-up upflag-angle downflag-angle)) (flag-length (+ (* raw-length factor) half-stem-thickness)) - ;; For flat flags the points to create the stencil using - ;; ly:round-filled-polygon need to be different concerning flag-end - (flag-end (if (= angle 0) - (cons flag-length (* half-stem-thickness dir)) - (polar->rectangular flag-length angle))) + (flag-end (polar->rectangular flag-length angle)) (thickness (* flag-thickness factor)) (thickness-offset (cons 0 (* -1 thickness dir))) (spacing (* -1 flag-spacing factor dir )) (start (cons (- half-stem-thickness) (* half-stem-thickness dir))) - (points (list start - flag-end - (offset-add flag-end thickness-offset) - (offset-add start thickness-offset))) + (raw-points + (list + '(0 . 0) + flag-end + (offset-add flag-end thickness-offset) + thickness-offset)) + (points (map (lambda (coord) (offset-add coord start)) raw-points)) (stencil (ly:round-filled-polygon points half-stem-thickness)) ;; Log for 1/8 is 3, so we need to subtract 3 (flag-stencil (buildflag stencil (- log 3) stencil spacing))