From 0b4a6579d13603db4c786c8ecbde2ae52b1c6050 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 5 Apr 2014 16:29:57 +0200 Subject: [PATCH] Issue 3880: bad number formatting in svg path output This uses ly:format with "~4f" format string rather than format with "~S" for formatting point lists. Note that "~4f" has a different meaning in ly:format as compared to plain format. This is consistent with other number formatting. Also does this for output of color. The previous output was problematic when the number was an exact fraction. --- scm/output-svg.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index d00757f4e2..1ddb276d31 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -83,7 +83,7 @@ (define (helper lst) (if (null? lst) '() - (cons (format #f "~S ~S" (car lst) (- (cadr lst))) + (cons (ly:format "~4f ~4f" (car lst) (- (cadr lst))) (helper (cddr lst))))) (string-join (helper lst) " ")) @@ -615,7 +615,7 @@ '(fill . "currentColor"))) (define (setcolor r g b) - (format #f "\n" + (ly:format "\n" (* 100 r) (* 100 g) (* 100 b))) ;; rotate around given point -- 2.39.2