From: Patrick McCarty Date: Tue, 28 Jul 2009 20:47:09 +0000 (-0700) Subject: SVG backend: cleanup 'path expression X-Git-Tag: release/2.13.4-1~264 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cc53bc17ad36cece69e2687cc935143edb0ccb79;p=lilypond.git SVG backend: cleanup 'path expression --- diff --git a/scm/output-svg.scm b/scm/output-svg.scm index b8ca001c71..f9222462dd 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -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) " ")) @@ -409,26 +409,24 @@ (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)))) '())) @@ -438,7 +436,7 @@ '(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)