X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fhorizontal-bracket.cc;h=13eec0c3ff00664bfefd55b2d245700eb61d5ef2;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=00dd0b653ff4d3f095b6574895b2219cb5c5e0d9;hpb=9b1d3ef007ba18e54dd46b38b835c6ec59140aa3;p=lilypond.git diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 00dd0b653f..13eec0c3ff 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--2008 Han-Wen Nienhuys */ #include "horizontal-bracket.hh" @@ -16,6 +16,8 @@ #include "staff-symbol-referencer.hh" #include "tuplet-bracket.hh" #include "axis-group-interface.hh" +#include "spanner.hh" +#include "item.hh" Stencil @@ -70,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) @@ -111,11 +119,9 @@ Horizontal_bracket::print (SCM smob) } ADD_INTERFACE (Horizontal_bracket, - - "horizontal-bracket-interface", "A horizontal bracket encompassing notes.", - /* props */ + /* properties */ "bracket-flare " "columns " "edge-height "