]> git.donarmstrong.com Git - lilypond.git/commitdiff
SVG backend: cleanup 'path expression
authorPatrick McCarty <pnorcks@gmail.com>
Tue, 28 Jul 2009 20:47:09 +0000 (13:47 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Tue, 28 Jul 2009 22:12:16 +0000 (15:12 -0700)
scm/output-svg.scm

index b8ca001c717edb34168e9d4196f2bc18efa5b405..f9222462dd0da5d3d4fa057b6257934d7d0fa7df 100644 (file)
@@ -84,7 +84,7 @@
   (define (helper lst)
     (if (null? lst)
        '()
-       (cons (format "~S,~S" (car lst) (cadr lst))
+       (cons (format "~S ~S" (car lst) (- (cadr lst)))
              (helper (cddr lst)))))
 
   (string-join (helper lst) " "))
   (define (convert-path-exps exps)
     (if (pair? exps)
        (let*
-           ((head (car exps))
-            (rest (cdr exps))
-            (arity
-             (cond
-              ((memq head '(rmoveto rlineto lineto moveto)) 2)
-              ((memq head '(rcurveto curveto)) 6)
-              (else 1)))
-            (args (take rest arity))
-            (svg-head (assoc-get head '((rmoveto . m)
-                                        (rcurveto . c)
-                                        (curveto . C)
-                                        (moveto . M)
-                                        (lineto . L)
-                                        (rlineto . l))
-                                 ""))
-            )
-
-         (cons (format "~a~a "
-                       svg-head (number-list->point args)
-                       )
+         ((head (car exps))
+          (rest (cdr exps))
+          (arity
+            (cond ((memq head '(rmoveto rlineto lineto moveto)) 2)
+                  ((memq head '(rcurveto curveto)) 6)
+                  (else 1)))
+          (args (take rest arity))
+          (svg-head (assoc-get head
+                               '((rmoveto . m)
+                                 (rcurveto . c)
+                                 (curveto . C)
+                                 (moveto . M)
+                                 (lineto . L)
+                                 (rlineto . l))
+                               "")))
+
+         (cons (format "~a~a"
+                       svg-head (number-list->point args))
                (convert-path-exps (drop rest arity))))
        '()))
 
          '(stroke-linecap . "round")
          '(stroke . "currentColor")
          '(fill . "none")
-         `(d . ,(string-join (convert-path-exps commands) " "))))
+         `(d . ,(apply string-append (convert-path-exps commands)))))
 
 (define (placebox x y expr)
   (if (string-null? expr)