From: Mike Solomon Date: Mon, 6 Feb 2012 15:59:00 +0000 (+0100) Subject: Gets rid of repeat-slash stencil command X-Git-Tag: release/2.15.29-1~9 X-Git-Url: https://git.donarmstrong.com/?p=lilypond.git;a=commitdiff_plain;h=c74e3c672472e22f28abc82d1705188add41a229 Gets rid of repeat-slash stencil command --- diff --git a/lily/lookup.cc b/lily/lookup.cc index 7b63b83111..f55e2f2a1e 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -490,21 +490,32 @@ Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve, Real thickness) Stencil Lookup::repeat_slash (Real w, Real s, Real t) { -#if 0 /* TODO */ - vector points; - Real blotdiameter = 0.0; - - Offset p1 (0, 0); - Offset p2 (w, w * s); - - return Lookup::round_filled_polygon (points, blotdiameter); -#endif - SCM wid = scm_from_double (w); - SCM sl = scm_from_double (s); - SCM thick = scm_from_double (t); - SCM slashnodot = scm_list_n (ly_symbol2scm ("repeat-slash"), - wid, sl, thick, SCM_UNDEFINED); + Real x_width = sqrt ((t * t) + ((t / s) * (t / s))); + Real height = w * s; + + SCM controls = scm_list_n (ly_symbol2scm ("moveto"), + scm_from_double (0), + scm_from_double (0), + ly_symbol2scm ("rlineto"), + scm_from_double (x_width), + scm_from_double (0), + ly_symbol2scm ("rlineto"), + scm_from_double (w), + scm_from_double (height), + ly_symbol2scm ("rlineto"), + scm_from_double (-x_width), + scm_from_double (0), + ly_symbol2scm ("closepath"), + SCM_UNDEFINED); + + SCM slashnodot = scm_list_n (ly_symbol2scm ("path"), + scm_from_double (0), + ly_quote_scm (controls), + ly_quote_scm (ly_symbol2scm ("round")), + ly_quote_scm (ly_symbol2scm ("round")), + SCM_BOOL_T, + SCM_UNDEFINED); Box b (Interval (0, w + sqrt (sqr (t / s) + sqr (t))), Interval (0, w * s)); diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index 2d17d57ab9..d7450e452b 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -138,18 +138,6 @@ bind def } ifelse } bind def -/draw_repeat_slash % x-width width height draw_repeat_slash -{ - 2 index % duplicate x-width - 1 setlinecap - 1 setlinejoin - - 0 rlineto % x-width 0 - rlineto % width height - neg 0 rlineto % -x-width 0 - closepath fill -} bind def - /draw_circle % filled? radius thickness draw_circle { setlinewidth % f? r diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm index 793be546b0..fddd6855b2 100644 --- a/scm/define-stencil-commands.scm +++ b/scm/define-stencil-commands.scm @@ -39,7 +39,6 @@ defined in the output modules (@file{output-*.scm})." partial-ellipse placebox polygon - repeat-slash resetcolor resetrotation resetscale diff --git a/scm/output-ps.scm b/scm/output-ps.scm index aa3cce06ae..7c8a6ed394 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -201,16 +201,6 @@ (- (/ (length points) 2) 1) blot-diameter)) -(define (repeat-slash width slope beam-thickness) - (define (euclidean-length x y) - (sqrt (+ (* x x) (* y y)))) - - (let ((x-width (euclidean-length beam-thickness (/ beam-thickness slope))) - (height (* width slope))) - (ly:format "~4l draw_repeat_slash" - (list x-width width height)))) - - (define (round-filled-box left right bottom top blotdiam) (let* ((halfblot (/ blotdiam 2)) (x (- halfblot left)) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index eaff362942..9f10629eac 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -572,17 +572,6 @@ `(points . ,(string-join (map offset->point (ly:list->offsets '() coords)))))) -(define (repeat-slash width slope thickness) - (define (euclidean-length x y) - (sqrt (+ (* x x) (* y y)))) - (let* ((x-width (euclidean-length thickness (/ thickness slope))) - (height (* width slope))) - (entity - 'path "" - '(fill . "currentColor") - `(d . ,(ly:format "M0 0l~4f 0 ~4f ~4f ~4f 0z" - x-width width (- height) (- x-width)))))) - (define (resetcolor) "\n")