]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4988 straight-flags partly wrong calculated
authorThomas Morley <thomasmorley65@gmail.com>
Tue, 25 Oct 2016 20:29:20 +0000 (22:29 +0200)
committerThomas Morley <thomasmorley65@gmail.com>
Sat, 5 Nov 2016 11:32:09 +0000 (12:32 +0100)
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.

input/regression/metronome-mark-formatter.ly
scm/define-markup-commands.scm
scm/flag-styles.scm

index a288c91ced20fd8d3a77f69a72fd14bd0824acab..841f6c40bbc4994cb1a4c42774f4d26b1a69712e 100644 (file)
@@ -108,6 +108,7 @@ mus =
     \context {
       \Score
       \override MetronomeMark.style = #'mensural
+      \override MetronomeMark.flag-style = #'mensural
     }
   }
 }
index 9ed4f9cc8301824433a9d39b7be0c59257c490cf..07f1538aa275dad7e07737548e2a0feb425f1b52 100644 (file)
@@ -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)))
index 2b52f44cb23516eb2ce7924dda97ac37b376231c..a2ddf3a9dd0bd8d728b2352c5ea7d03dbcc2b324 100644 (file)
@@ -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))