]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest.cc
release: 1.1.7
[lilypond.git] / lily / rest.cc
index e11eef1489d230da2d852e94d8aca89441b2b534..d9d2b765d004a3e4a835ce18a4b8ec2fa24bce17 100644 (file)
@@ -1,9 +1,9 @@
 /*
-  rest.cc -- implement 
+  rest.cc -- implement Rest
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "molecule.hh"
 void
 Rest::do_add_processing ()
 {
-  if (balltype_i_ == 0)
-    position_i_ += 4;
-  else if (balltype_i_ == 1)
-    position_i_ += 4;
+  if (balltype_i_ > 1)
+    position_i_ -= 4;
+  else if (balltype_i_ == 0)
+    position_i_ += 2;
+
   Rhythmic_head::do_add_processing ();
-  if (dots_l_)
-      dots_l_->position_i_ = position_i_;
+  if (dots_l_ && balltype_i_ > 1)
+    {
+      dots_l_->position_i_ = position_i_ + 4;
+    }
 }
 
 Rest::Rest ()
@@ -34,13 +37,14 @@ Rest::Rest ()
 Molecule *
 Rest::brew_molecule_p () const
 {
-  int staff_size_i_ =8;
-  bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1);
+  int staff_size_i_ = 8;
+  bool streepjes_b = abs(position_i_) > staff_size_i_ /2 &&  
+    (balltype_i_ == 0 || balltype_i_ == 1);
   
-  Atom s(paper ()->lookup_l()->rest (balltype_i_, streepjes_b));
+  Atom s(lookup_l ()->rest (balltype_i_, streepjes_b));
   Molecule * m = new Molecule ( Atom (s));
-  m->translate (position_i_ *  paper ()->internote_f (), Y_AXIS);
+  m->translate_axis (position_i_ *  paper ()->internote_f (), Y_AXIS);
   return m;
 }
 
-IMPLEMENT_IS_TYPE_B1(Rest, Rhythmic_head);
+