]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/enclosing-bracket.cc
Imported Upstream version 2.14.2
[lilypond.git] / lily / enclosing-bracket.cc
index 60e98f0944e9131c89023620f53d8a30bdbf5b62..d7cd67284377ac23f607e4578296cb326441badc 100644 (file)
@@ -1,10 +1,21 @@
 /*
-  enclosing-bracket.cc -- implement Enclosing_bracket
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-  (c) 2005--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 "stencil.hh"
 
 struct Enclosing_bracket
 {
-  DECLARE_GROB_INTERFACE();
+  DECLARE_GROB_INTERFACE ();
   
 public:
-  DECLARE_SCHEME_CALLBACK(print, (SCM));
-  DECLARE_SCHEME_CALLBACK(width, (SCM));
+  DECLARE_SCHEME_CALLBACK (print, (SCM));
+  DECLARE_SCHEME_CALLBACK (width, (SCM));
 };
 
 
-ADD_INTERFACE(Enclosing_bracket,
-             
+ADD_INTERFACE (Enclosing_bracket,
              "Brackets alongside bass figures.",
              
-             /* props */
+             /* properties */
              "bracket-flare "
              "edge-height "
              "elements "
@@ -85,7 +95,11 @@ Enclosing_bracket::print (SCM grob)
 
   Grob *common_x = common_refpoint_of_array (elements, me, X_AXIS); 
   Interval xext = Axis_group_interface::relative_group_extent (elements, common_x, X_AXIS);
-
+  if (xext.is_empty ())
+    {
+      me->programming_error ("elements have no X extent.");
+      xext = Interval (0, 0);
+    }
 
   Stencil left_br = Horizontal_bracket::make_enclosing_bracket (me, me, elements,
                                                                Y_AXIS, LEFT);