From: Patrick McCarty Date: Sun, 26 Jul 2009 04:23:34 +0000 (-0700) Subject: SVG backend: round real-number values for 4 places X-Git-Tag: release/2.13.4-1~291 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ef43ccb52b944cf8bd8575e184cd9458c28c5368;p=lilypond.git 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. --- 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)