]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spring.cc
patch::: 1.3.95.tca2
[lilypond.git] / lily / spring.cc
index c52b464bc36f2294ca7e9b95a861915c59c010b7..e5136a82ffb3e9ad4e47f468a160699648b87774 100644 (file)
@@ -3,13 +3,14 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "spring.hh"
 #include "debug.hh"
 #include "item.hh"
+#include "spaceable-element.hh"
 #include "paper-column.hh"
 
 Spring::Spring ()
@@ -22,14 +23,9 @@ Spring::Spring ()
 void
 Spring::add_to_cols ()
 {
-  Direction d = LEFT;
-  do
-    {
-      item_l_drul_[-d]->column_l ()->add_spring
-       (item_l_drul_[d]->column_l (),
-        distance_f_, strength_f_);
-    }
-  while ((flip (&d))!=LEFT);
+  Spaceable_element::add_spring (item_l_drul_[LEFT]->column_l (),
+                                item_l_drul_[RIGHT]->column_l (),
+                                distance_f_, strength_f_);
 }
 
 
@@ -41,18 +37,4 @@ Column_spring::Column_spring ()
 }
 
 
-int
-Column_spring::compare (Column_spring const & r1, Column_spring const &r2)
-{
-  return r1.other_l_->rank_i() - r2.other_l_->rank_i();
-}
-
-void
-Column_spring::print () const
-{
-#ifndef NPRINT
-  DEBUG_OUT << "Column_spring { rank = "
-       << other_l_->rank_i () << ", dist = " << distance_f_ << "}\n";   
 
-#endif
-}