From ef43ccb52b944cf8bd8575e184cd9458c28c5368 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Sat, 25 Jul 2009 21:23:34 -0700 Subject: [PATCH] SVG backend: round real-number values for 4 places This is part of the SVG Tiny 1.2 spec Note that the "path" stencil expression still needs rounding treatment too. --- scm/output-svg.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 082ccd92b8..987dc07528 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -48,7 +48,12 @@ ;; Helper functions (define-public (attributes attributes-alist) (apply string-append - (map (lambda (x) (format " ~s=\"~a\"" (car x) (cdr x))) + (map (lambda (x) + (let ((attr (car x)) + (value (cdr x))) + (if (number? value) + (set! value (ly:format "~4f" value))) + (format " ~s=\"~a\"" attr value))) attributes-alist))) (define-public (eo entity . attributes-alist) -- 2.39.2