]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/spring.cc
release: 1.3.142
[lilypond.git] / lily / spring.cc
index 8ba0ff79667b3261c665fcdb977ad1f49d408cb8..476007d1228bff4bce2aa2de3a2c99ffeb51080d 100644 (file)
@@ -3,14 +3,15 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "spring.hh"
 #include "debug.hh"
 #include "item.hh"
-#include "p-col.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_grob::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
-  DOUT << "Column_spring { rank = "
-       << other_l_->rank_i () << ", dist = " << distance_f_ << "}\n";   
 
-#endif
-}