X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fhorizontal-bracket.cc;h=07c32552649e16b0e89f74341b172748015740a9;hb=a4a44d90fd0bf8cd01d7491e6a8aba610c893031;hp=d2b016b49625419ee6a4a7c1005242e7842aaa13;hpb=2c8c61b3a5cddbb155786a1ca027528701c91ac9;p=lilypond.git diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index d2b016b496..07c3255264 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2002--2006 Han-Wen Nienhuys + (c) 2002--2007 Han-Wen Nienhuys */ #include "horizontal-bracket.hh" @@ -72,19 +72,25 @@ Horizontal_bracket::make_enclosing_bracket (Grob *me, Grob *refpoint, 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)