X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=inline;f=lily%2Fstencil-scheme.cc;h=c8d87439d67452e497049886b7cd25bf55cfa194;hb=ec91a9a4bdd186d7af88381a10a2923ac949d33c;hp=fec4c13f1eae0db70c78e4b31fad601a572de0ee;hpb=f127e14af04f474d20406ca0e0f76f05061ee103;p=lilypond.git diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index fec4c13f1e..c8d87439d6 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -22,8 +22,6 @@ #include "lookup.hh" #include "stencil.hh" -using std::vector; - /* TODO: naming add/combine. */ @@ -415,14 +413,23 @@ LY_DEFINE (ly_round_filled_box, "ly:round-filled-box", } LY_DEFINE (ly_round_filled_polygon, "ly:round-filled-polygon", - 2, 0, 0, - (SCM points, SCM blot), + 2, 1, 0, + (SCM points, SCM blot, SCM extroversion), "Make a @code{Stencil} object that prints a black polygon with" " corners at the points defined by @var{points} (list of coordinate" - " pairs) and roundness @var{blot}.") + " pairs) and roundness @var{blot}. Optional" + "@var{extroversion} shifts the outline outward, with the" + "default of@tie{}@code{-1.0} keeping the outer boundary of" + "the outline just inside of the polygon.") { SCM_ASSERT_TYPE (scm_ilength (points) > 0, points, SCM_ARG1, __FUNCTION__, "list of coordinate pairs"); LY_ASSERT_TYPE (scm_is_number, blot, 2); + Real ext = -1; + if (!SCM_UNBNDP (extroversion)) + { + LY_ASSERT_TYPE (scm_is_number, extroversion, 3); + ext = scm_to_double (extroversion); + } vector pts; for (SCM p = points; scm_is_pair (p); p = scm_cdr (p)) { @@ -436,7 +443,8 @@ LY_DEFINE (ly_round_filled_polygon, "ly:round-filled-polygon", // TODO: Print out warning } } - return Lookup::round_filled_polygon (pts, scm_to_double (blot)).smobbed_copy (); + return Lookup::round_filled_polygon (pts, scm_to_double (blot), ext) + .smobbed_copy (); } LY_DEFINE (ly_register_stencil_expression, "ly:register-stencil-expression",