/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
#include "line-interface.hh"
#include "warn.hh"
+#include "international.hh"
#include "dimensions.hh"
#include "bezier.hh"
#include "file-path.hh"
Stencil
Lookup::blank (Box b)
{
- return Stencil (b, scm_from_locale_string (""));
+ return Stencil (b, scm_string (SCM_EOL));
}
Stencil
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]),
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]),