]> git.donarmstrong.com Git - lilypond.git/commitdiff
SVG backend: round real-number values for 4 places
authorPatrick McCarty <pnorcks@gmail.com>
Sun, 26 Jul 2009 04:23:34 +0000 (21:23 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Sun, 26 Jul 2009 04:23:34 +0000 (21:23 -0700)
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

index 082ccd92b854e25ca6ba2236a70fa548cbbbb7c6..987dc0752890cf9f82ed9dede3a2b2275b0069a3 100644 (file)
 ;; 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)