]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/flag-styles.scm
Fixes Czech ponding
[lilypond.git] / scm / flag-styles.scm
index bce6cab5db494f2811a0782fa3943170874376e6..23ff235201fb1f20920b48022adc925123758906 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2008--2011 Reinhold Kainhofer <reinhold@kainhofer.com>
+;;;; Copyright (C) 2008--2012 Reinhold Kainhofer <reinhold@kainhofer.com>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
@@ -188,7 +188,14 @@ a flag always touches a staff line."
 
   (let* ((stem-grob (ly:grob-parent grob X))
          (adjust #t)
-         (stem-end (inexact->exact (round (ly:grob-property stem-grob 'stem-end-position))))
+         (d (ly:grob-property stem-grob 'direction))
+         (ss (ly:staff-symbol-staff-space stem-grob))
+         (stem-end (inexact->exact (round (* (index-cell
+                                               (ly:grob-extent stem-grob
+                                                               stem-grob
+                                                               Y)
+                                               d)
+                                             (/ 2 ss)))))
          ; For some reason the stem-end is a real instead of an integer...
          (dir-modifier (if (ly:position-on-line? stem-grob stem-end) "1" "0"))
          (modifier (if adjust dir-modifier "2")))