/*
- horizontal-bracket.cc -- implement Horizontal_bracket
+ This file is part of LilyPond, the GNU music typesetter.
- source file of the GNU LilyPond music typesetter
+ Copyright (C) 2002--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
- (c) 2002--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ LilyPond is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LilyPond is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
*/
#include "horizontal-bracket.hh"
Grob *common = common_refpoint_of_array (grobs, refpoint, a);
Interval ext = Axis_group_interface::relative_group_extent (grobs, common, a);
- Stencil b = make_bracket (me, ext.length(), a, dir);
- b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a), a);
+ if (ext.is_empty ())
+ {
+ me->programming_error ("Can't enclose empty extents with bracket");
+ return Stencil ();
+ }
+ else
+ {
+ Stencil b = make_bracket (me, ext.length (), a, dir);
+ b.translate_axis (ext[LEFT] - refpoint->relative_coordinate (common, a), a);
- return b;
+ return b;
+ }
}
-
/*
TODO:
Support texts on the brackets?
*/
-
MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
SCM
Horizontal_bracket::print (SCM smob)
ADD_INTERFACE (Horizontal_bracket,
"A horizontal bracket encompassing notes.",
- /* props */
+ /* properties */
"bracket-flare "
"columns "
"edge-height "