]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/span-bar.cc
Adds Ponding for Nicolas Sceaux's project.
[lilypond.git] / lily / span-bar.cc
index 4cc9971d5da80fc3550f077a53cdad6014da9182..29a871a62dc11920eee6bd4aad51de99495a4f39 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2012 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
@@ -88,8 +88,6 @@ Span_bar::print (SCM smobbed_me)
   if (!model_bar)
     model_bar = me;
 
-  vector_sort (extents, Interval::left_less);
-
   Stencil span_bar;
   for (vsize i = 1; i < extents.size (); i++)
     {
@@ -216,6 +214,18 @@ Span_bar::calc_glyph_name (SCM smob)
   return ly_string2scm (type);
 }
 
+void
+Span_bar::notify_grobs_of_my_existence (Grob *me)
+{
+  extract_grob_set (me, "elements", elts);
+  vector<Grob *> sortable (elts.begin (), elts.end ());
+  vector_sort (sortable, Grob::vertical_less);
+  for (vsize i = 0; i < sortable.size (); i++)
+    sortable[i]->set_property ("has-span-bar",
+                               scm_cons (i != sortable.size () - 1 ? me->self_scm () : scm_from_bool (false),
+                                         i != 0 ? me->self_scm () : scm_from_bool (false)));
+}
+
 Interval
 Span_bar::get_spanned_interval (Grob *me)
 {