X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flookup.cc;h=9bef343fedd5625714c1e6846ef1b7ee64a41c1d;hb=17116996706960c9793102429ef629721b7e59a3;hp=e0117c1da197fd42c14a82a51c20c1f83008c5ec;hpb=2da5a512119ca9dda3a05e1c122daea5b17f9049;p=lilypond.git diff --git a/lily/lookup.cc b/lily/lookup.cc index e0117c1da1..9bef343fed 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2012 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys Jan Nieuwenhuizen @@ -27,6 +27,7 @@ using namespace std; #include "line-interface.hh" #include "warn.hh" +#include "international.hh" #include "dimensions.hh" #include "bezier.hh" #include "file-path.hh" @@ -169,13 +170,18 @@ Lookup::filled_box (Box b) Stencil Lookup::round_filled_box (Box b, Real blotdiameter) { - if (b.x ().length () < blotdiameter) - blotdiameter = b.x ().length (); - if (b.y ().length () < blotdiameter) - blotdiameter = b.y ().length (); + Real width = b.x ().delta (); + blotdiameter = min (blotdiameter, width); + Real height = b.y ().delta (); + blotdiameter = min (blotdiameter, height); - if (b.x ().is_empty () || b.y ().is_empty ()) - return Stencil (b, SCM_EOL); + if (blotdiameter < 0.0) + { + if (!isinf (blotdiameter)) + warning (_f ("Not drawing a box with negative dimension, %.2f by %.2f.", + width, height)); + return Stencil (b, SCM_EOL); + } SCM at = (scm_list_n (ly_symbol2scm ("round-filled-box"), scm_from_double (-b[X_AXIS][LEFT]), @@ -460,6 +466,9 @@ Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve, Real thickness) scm_from_double (top_curve.control_[2][Y_AXIS]), scm_from_double (top_curve.control_[3][X_AXIS]), scm_from_double (top_curve.control_[3][Y_AXIS]), + ly_symbol2scm ("lineto"), + scm_from_double (bottom_curve.control_[3][X_AXIS]), + scm_from_double (bottom_curve.control_[3][Y_AXIS]), ly_symbol2scm ("curveto"), scm_from_double (bottom_curve.control_[2][X_AXIS]), scm_from_double (bottom_curve.control_[2][Y_AXIS]),