]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem.cc
* lily/tuplet-bracket.cc (brew_molecule): call after_line_breaking
[lilypond.git] / lily / stem.cc
index eaedf13ec82dc12d73b1eeec409d182101086408..ce268868663a9d1ce443bc432d65fed81c50b1d2 100644 (file)
@@ -259,7 +259,7 @@ Stem::get_default_dir (Grob*me)
 {
   int staff_center = 0;
   Interval hp = head_positions (me);
-  if (hp.empty_b())
+  if (hp.is_empty ())
     {
       return CENTER;
     }
@@ -356,7 +356,7 @@ Stem::get_default_stem_end_position (Grob*me)
       if (durlog >= 3)
        {
          Interval flag_ext = flag (me).extent (Y_AXIS) ;
-         if (!flag_ext.empty_b())
+         if (!flag_ext.is_empty ())
            minlen += 2 * flag_ext.length () / ss ;
 
          /*
@@ -479,16 +479,21 @@ Stem::position_noteheads (Grob*me)
              Real l = Note_head::head_extent (heads[i], X_AXIS).length ();
 
              Direction d = get_direction (me);
-             /* reversed head should be shifted l-thickness, but this looks
-                too crowded, so we only shift l-0.5*thickness.
-                Notice that this leads to assymetry: Normal heads overlap
-                the stem 100% whereas reversed heads only overlaps the stem
-                50% */
-             #define magic 0.5
-             heads[i]->translate_axis ((l-thick*magic) * d, X_AXIS);
+             /*
+               Reversed head should be shifted l-thickness, but this
+               looks too crowded, so we only shift l-0.5*thickness.
+
+               This leads to assymetry: Normal heads overlap the
+               stem 100% whereas reversed heads only overlaps the
+               stem 50%
+
+             */
+
+             Real reverse_overlap =0.5;
+             heads[i]->translate_axis ((l-thick*reverse_overlap) * d, X_AXIS);
 
              if (invisible_b(me))
-               heads[i]->translate_axis (-thick*(2-magic) * d , X_AXIS);
+               heads[i]->translate_axis (-thick*(2 - reverse_overlap) * d , X_AXIS);
 
              
             /* TODO:
@@ -641,7 +646,7 @@ Stem::flag (Grob*me)
     flag_style + to_string (dir) + staffline_offs + to_string (duration_log (me));
   Font_metric *fm = Font_interface::get_default_font (me);
   Molecule flag = fm->find_by_name ("flags-" + font_char);
-  if (flag.empty_b ())
+  if (flag.is_empty ())
     {
       me->warning (_f ("flag `%s' not found", font_char));
     }
@@ -650,11 +655,11 @@ Stem::flag (Grob*me)
   if (gh_string_p (stroke_style_scm))
     {
       String stroke_style = ly_scm2string (stroke_style_scm);
-      if (!stroke_style.empty_b ())
+      if (!stroke_style.is_empty ())
        {
          String font_char = to_string (dir) + stroke_style;
          Molecule stroke = fm->find_by_name ("flags-" + font_char);
-         if (stroke.empty_b ())
+         if (stroke.is_empty ())
            {
              me->warning (_f ("flag stroke `%s' not found", font_char));
            }
@@ -732,7 +737,7 @@ Stem::brew_molecule (SCM smob)
        must not take ledgers into account.
        */
       Interval head_height = Note_head::head_extent (hed,Y_AXIS);
-      Real y_attach = Note_head::stem_attachment_coordinate ( hed, Y_AXIS);
+      Real y_attach = Note_head::stem_attachment_coordinate (hed, Y_AXIS);
 
       y_attach = head_height.linear_combination (y_attach);
       stem_y[Direction (-d)] += d * y_attach/dy;
@@ -781,7 +786,6 @@ Stem::off_callback (SCM element_smob, SCM)
   if (Grob * f = first_head (me))
     {
       Interval head_wid = Note_head::head_extent(f, X_AXIS);
-
       
       Real attach =0.0;
 
@@ -806,7 +810,6 @@ Stem::off_callback (SCM element_smob, SCM)
          Real rule_thick
            = gh_scm2double (me->get_grob_property ("thickness"))
            * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
-
          
          r += - d * rule_thick * 0.5;
        }
@@ -814,6 +817,7 @@ Stem::off_callback (SCM element_smob, SCM)
   return gh_double2scm (r);
 }
 
+
 Grob*
 Stem::get_beam (Grob*me)
 {
@@ -940,7 +944,7 @@ Stem::calc_stem_info (Grob *me)
     /* stem only extends to center of beam */
     - 0.5 * beam_thickness;
 
- Real minimum_y = note_start + minimum_length;
 Real minimum_y = note_start + minimum_length;
   
   
   ideal_y *= my_dir;