]> git.donarmstrong.com Git - lilypond.git/commitdiff
Gets rid of repeat-slash stencil command
authorMike Solomon <mike@apollinemike.com>
Mon, 6 Feb 2012 15:59:00 +0000 (16:59 +0100)
committerMike Solomon <mike@apollinemike.com>
Mon, 6 Feb 2012 15:59:16 +0000 (16:59 +0100)
lily/lookup.cc
ps/music-drawing-routines.ps
scm/define-stencil-commands.scm
scm/output-ps.scm
scm/output-svg.scm

index 7b63b83111e4ccf9000710f087d526453c2d1176..f55e2f2a1e84767b1fc9dbcad15aaf92406fa72a 100644 (file)
@@ -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<Offset> 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));
index 2d17d57ab9f0e2cc00dc0132c9f43c6fd8023139..d7450e452bee0c239f10fca06e70f4f40a5c40b4 100644 (file)
@@ -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
index 793be546b056213b758203fda22a86ce96de0c45..fddd6855b2f0a2b22a99527ae89e28be060a9237 100644 (file)
@@ -39,7 +39,6 @@ defined in the output modules (@file{output-*.scm})."
     partial-ellipse
     placebox
     polygon
-    repeat-slash
     resetcolor
     resetrotation
     resetscale
index aa3cce06ae56d9d2a9093e5e096bbf9bb4e0e564..7c8a6ed39474fa5560002fb71f3744d4bf614047 100644 (file)
             (- (/ (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))
index eaff36294263541245257708998c036dca08fd9c..9f10629eacf7a6f2a3f4fc913aaa5ff3ee9a65a3 100644 (file)
     `(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)
   "</g>\n")