X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flookup.cc;h=344d42c906d3344404a1753110c3a08642d5846c;hb=e24fb7cc5671aea95211d4a0c56f28fb6fe8720e;hp=1acb34f783cf83dab6b0cc503f8d55fb47852a0e;hpb=46e296f5381495ce30108aa981e549d61e55a009;p=lilypond.git diff --git a/lily/lookup.cc b/lily/lookup.cc index 1acb34f783..344d42c906 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--2014 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,10 +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 (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]),