]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem.cc
* VERSION: 1.5.72 released
[lilypond.git] / lily / stem.cc
index ceefac9709c6f2978ede0cdbce8212834efe914e..b17f0a383afaec3ec435f8ef552fdcec6193c774 100644 (file)
@@ -123,7 +123,9 @@ Stem::set_stemend (Grob*me, Real se)
 
 /*
   Note head that determines hshift for upstems
- */ 
+
+  WARNING: triggers direction
+*/ 
 Grob*
 Stem::support_head (Grob*me)
 {
@@ -152,7 +154,9 @@ Stem::head_count (Grob*me)
 
 /*
   The note head which forms one end of the stem.  
- */
+
+  WARNING: triggers direction
+*/
 Grob*
 Stem::first_head (Grob*me)
 {
@@ -246,7 +250,8 @@ Stem::add_head (Grob*me, Grob *n)
 bool
 Stem::invisible_b (Grob*me)
 {
-  return ! (head_count (me) && Note_head::get_balltype (support_head (me)) >= 1);
+  return ! (head_count (me)
+           && gh_scm2int (me->get_grob_property ("duration-log")) >= 1);
 }
 
 Direction
@@ -486,7 +491,7 @@ Stem::before_line_breaking (SCM smob)
     }
   else
     {
-      me->remove_grob_property ("molecule-callback");
+      me->set_grob_property ("molecule-callback", SCM_EOL);
     }
   
   return SCM_UNSPECIFIED;
@@ -799,7 +804,7 @@ Stem::calc_stem_info (Grob*me)
   Real half_space = staff_space / 2;
 
   Grob * beam = get_beam (me);
-  int beam_count = beam_multiplicity(me).length()+1;
+  int beam_count = Beam::get_direction_beam_count (beam, mydir);
   Real beam_translation= Beam::get_beam_translation (beam);
   Real thick = gh_scm2double (beam->get_grob_property ("thickness"));
   Real note_start = chord_start_y (me);
@@ -810,11 +815,11 @@ Stem::calc_stem_info (Grob*me)
   SCM grace_prop = me->get_grob_property ("grace");
   
   bool grace_b = to_boolean (grace_prop);
-  SCM bml = robust_list_ref ( beam_count ,
+  SCM bml = robust_list_ref ( beam_count - 1,
                              me->get_grob_property ("beamed-minimum-lengths"));
 
   Real minimum_length = gh_scm2double(bml)*staff_space;
-  SCM bl =  robust_list_ref ( beam_count ,
+  SCM bl =  robust_list_ref ( beam_count - 1,
                              me->get_grob_property ("beamed-lengths"));
   Real stem_length =  gh_scm2double(bl) * staff_space;
 
@@ -823,7 +828,7 @@ Stem::calc_stem_info (Grob*me)
     stem goes to center of beam, hence 0.5
    */
   Real beam_lengthen = beam_translation* (beam_count - 1)
-    + ((beam_count > 0) ? thick : 0) - 0.5 * thick;
+    + 0.5 * thick;
 
   Real shortest_y = note_start + minimum_length + beam_lengthen;
   Real ideal_y = stem_length + note_start + beam_lengthen;
@@ -891,6 +896,6 @@ Stem::beam_multiplicity (Grob *stem)
 
 ADD_INTERFACE (Stem,"stem-interface",
   "A stem",
-  "up-to-staff avoid-note-head adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head note-heads direction length style no-stem-extend flag-style dir-forced");
+  "up-to-staff avoid-note-head adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head note-heads direction length style no-stem-extend flag-style");