]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/horizontal-bracket.cc
Run `make grand-replace'.
[lilypond.git] / lily / horizontal-bracket.cc
index d2b016b49625419ee6a4a7c1005242e7842aaa13..13eec0c3ff00664bfefd55b2d245700eb61d5ef2 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2002--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2002--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #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)
@@ -115,7 +121,7 @@ Horizontal_bracket::print (SCM smob)
 ADD_INTERFACE (Horizontal_bracket,
               "A horizontal bracket encompassing notes.",
 
-              /* props */                
+              /* properties */           
               "bracket-flare "
               "columns "
               "edge-height "