]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/single-malt-grouping-item.cc
release: 1.2.4
[lilypond.git] / lily / single-malt-grouping-item.cc
index c030ffafe68f1b47294dac46aac58479e4e81399..cc778169836daa5d0733031f2972231736948e5b 100644 (file)
@@ -3,18 +3,22 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "single-malt-grouping-item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
 #include "debug.hh"
 
 Single_malt_grouping_item ::Single_malt_grouping_item()
 {
-  transparent_b_ = true;
-  set_empty (true);
+  set_elt_property (break_helper_only_scm_sym, SCM_BOOL_T);
+  set_elt_property (transparent_scm_sym, SCM_BOOL_T);
+
+  // this is weird! , but needed!
+  set_empty (true, X_AXIS, Y_AXIS);
+
 }
 
 void
@@ -33,8 +37,19 @@ Single_malt_grouping_item::my_width () const
   for (int i=0; i < item_l_arr_.size (); i++)
     {
       Item *il = item_l_arr_[i];
-      assert (pc == il->column_l ());
-      w.unite  (il->width () + il->relative_coordinate (pc, X_AXIS));
+      if (pc != il->column_l ())
+       {
+         /* this shouldn't happen, but let's continue anyway. */
+         programming_error (_("Single_malt_grouping_item: I've been drinking too much"));
+         continue;             /*UGH UGH*/ 
+       }
+
+      Interval iv (il->extent (X_AXIS));
+      if (!iv.empty_b ())
+       {
+         Real off = il->relative_coordinate (pc, X_AXIS);
+         w.unite  (iv + off);
+       }
     }
 
   return w;
@@ -44,7 +59,8 @@ Single_malt_grouping_item::my_width () const
 
 
 void
-Single_malt_grouping_item::do_substitute_dependency (Score_element*o, Score_element*n)
+Single_malt_grouping_item::do_substitute_element_pointer (Score_element*o,
+                                                         Score_element*n)
 {
   if (dynamic_cast <Item *> (o))
     {