From 85a44acc42888c7bae5206e317b238e21f0b8c6b Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Sun, 7 Jan 2007 18:19:46 +0100
Subject: [PATCH] Fix #226.

And move the dot in case of a flag.
---
 input/regression/markup-note-dot.ly | 20 ++++++++++++++++++++
 scm/define-markup-commands.scm      | 14 ++++++--------
 2 files changed, 26 insertions(+), 8 deletions(-)
 create mode 100644 input/regression/markup-note-dot.ly

diff --git a/input/regression/markup-note-dot.ly b/input/regression/markup-note-dot.ly
new file mode 100644
index 0000000000..517f541653
--- /dev/null
+++ b/input/regression/markup-note-dot.ly
@@ -0,0 +1,20 @@
+
+\header {
+
+  texidoc = " A dotted whole note displayed via the @code{\\note}
+  command must separate the note head and the dot. The dot avoids the upflag."
+
+	}
+\paper {
+  packed = ##T
+}
+
+\version "2.10.10"
+
+
+\relative {
+  c^\markup { \note #"1." #1 }
+  c^\markup { \note #"2." #1 }
+  c^\markup { \note #"8." #1 }
+}
+
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index 71407e60cd..b9f8230506 100644
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -1238,8 +1238,8 @@ figured bass notation"
                     (apply ly:stencil-add
                            (map (lambda (x)
                                   (ly:stencil-translate-axis
-                                   dot  (* (+ 1 (* 2 x)) dotwid) X))
-                                (iota dot-count 1)))))
+                                   dot (* 2 x dotwid) X))
+                                (iota dot-count)))))
          (flaggl (and (> log 2)
                       (ly:stencil-translate
                        (ly:font-get-glyph font
@@ -1247,6 +1247,9 @@ figured bass notation"
 							 (if (> dir 0) "u" "d")
 							 (number->string log)))
                        (cons (+ (car attach-off) (/ stem-thickness 2)) stemy)))))
+
+    (if (and flaggl (> dir 0))
+	(set! dots (ly:stencil-translate-axis dots 0.35 X)))
     (if flaggl
         (set! stem-glyph (ly:stencil-add flaggl stem-glyph)))
     (if (ly:stencil? stem-glyph)
@@ -1257,12 +1260,7 @@ figured bass notation"
               (ly:stencil-add
                (ly:stencil-translate-axis
 		dots
-		(+ (if (and (> dir 0) (> log 2))
-		       (* 1.5 dotwid)
-		       0)
-		   ;; huh ? why not necessary?
-		   ;;(cdr (ly:stencil-extent head-glyph X))
-		   dotwid)
+		(+ (cdr (ly:stencil-extent head-glyph X)) dotwid)
 		X)
                stem-glyph)))
     stem-glyph))
-- 
2.39.5