]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem-info.cc
release: 1.2.4
[lilypond.git] / lily / stem-info.cc
index 2993559a848849a5a8a812b0facca82022936a55..930130da2bb0f96ec120d147d5088e5dab5886fc 100644 (file)
@@ -10,6 +10,7 @@
 #include "proto.hh"
 #include "misc.hh"
 #include "debug.hh"
+#include "dimension-cache.hh"
 
 #include "align-element.hh"
 #include "stem.hh"
@@ -63,7 +64,7 @@ Stem_info::Stem_info (Stem*s, int mult)
   int stem_max = (int)rint(paper_l->get_var ("stem_max"));
   String type_str = grace_b ? "grace_" : "";
   Real min_stem_f = paper_l->get_var (type_str + "minimum_stem_length"
-                                     + to_str (mult_i_ <? stem_max));
+                                     + to_str (mult_i_ <? stem_max)) * internote_f;
   Real stem_f = paper_l->get_var (type_str + "stem_length"
                                  + to_str (mult_i_ <? stem_max))* internote_f;
 
@@ -130,8 +131,8 @@ Stem_info::Stem_info (Stem*s, int mult)
   // interstaff beam
   Beam* beam_l = stem_l_->beam_l_;
   
-  Dimension_cache *common = stem_l_->common_group (beam_l, Y_AXIS);
-  Align_element * align = dynamic_cast<Align_element*> (common->element_l ());
+  Graphical_element *common = stem_l_->common_refpoint (beam_l, Y_AXIS);
+  Align_element * align = dynamic_cast<Align_element*> (common);
   if (align && align->axis() == Y_AXIS)
     {
       if (align->threshold_interval_[MIN] != 
@@ -140,19 +141,19 @@ Stem_info::Stem_info (Stem*s, int mult)
 
       interstaff_f_ = align->threshold_interval_[MIN] / internote_f;
 
-      Dimension_cache * beam_refpoint = beam_l->dim_cache_[Y_AXIS];
-      Dimension_cache * stem_refpoint = stem_l_->dim_cache_[Y_AXIS];
+      Graphical_element * beam_refpoint = beam_l;
+      Graphical_element * stem_refpoint = stem_l_;
 
-      while (beam_refpoint->parent_l_ != common)
-       beam_refpoint = beam_refpoint->parent_l_;
-      while (stem_refpoint->parent_l_ != common)
-       stem_refpoint = stem_refpoint->parent_l_;
+      while (beam_refpoint->parent_l (Y_AXIS) != common)
+       beam_refpoint = beam_refpoint->parent_l (Y_AXIS);
+      while (stem_refpoint->parent_l (Y_AXIS) != common)
+       stem_refpoint = stem_refpoint->parent_l (Y_AXIS);
 
 
       int beam_prio =
-       align->get_priority (dynamic_cast<Score_element*> (beam_refpoint->element_l ()));
+       align->get_priority (dynamic_cast<Score_element*> (beam_refpoint));
       int stem_prio =
-       align->get_priority (dynamic_cast<Score_element*> (stem_refpoint->element_l ()));
+       align->get_priority (dynamic_cast<Score_element*> (stem_refpoint));
 
       /*
        our staff is lower -> interstaff_f_ *= -1