]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-spacing.cc
2003 -> 2004
[lilypond.git] / lily / note-spacing.cc
index 80a789e418c499f90fa0afb03b5424946cd01e3a..1b60b1cec59bc725ffefa23d2b126d0bfc52d748 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2001--2003  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2001--2004  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
@@ -92,7 +92,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
            }
        }
 
-      if (extents[d].empty_b ())
+      if (extents[d].is_empty ())
        extents[d] = Interval (0,0);
     }
   while (flip (&d) != LEFT);
@@ -108,7 +108,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
     FIXED also includes the left part of the right object.
   */
   *fixed =
-    (left_head_wid.empty_b () ? increment :
+    (left_head_wid.is_empty () ? increment :
      /*
        Size of the head:
       */
@@ -122,7 +122,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
     /*
       What is sticking out of the right note:
      */
-    + (extents[RIGHT].empty_b() ?  0.0 : - extents[RIGHT][LEFT] / 2);
+    + (extents[RIGHT].is_empty () ?  0.0 : - extents[RIGHT][LEFT] / 2);
 
   /*
     We don't do complicated stuff: (base_space - increment) is the
@@ -269,7 +269,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
                      it = it->find_prebroken_piece (rcolumn->break_status_dir ());
                    }
                  
-                 Grob *last = Staff_spacing::extremal_break_aligned_grob (it, LEFT, &bar_xextent);
+                 Grob *last = Separation_item::extremal_break_aligned_grob (it, LEFT, &bar_xextent);
 
                  if (last)
                    bar_yextent = Staff_spacing::bar_y_positions (last);
@@ -327,7 +327,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
 
   Real correction = 0.0;
 
-  if (!bar_yextent.empty_b())
+  if (!bar_yextent.is_empty ())
     {
       stem_dirs[RIGHT] = - stem_dirs[LEFT];
       stem_posns[RIGHT] = bar_yextent;
@@ -350,27 +350,26 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
            {
              head_extent = head->extent (rcolumn, X_AXIS);
 
-             if (!head_extent.empty_b())
+             if (!head_extent.is_empty ())
                note_head_width = head_extent[RIGHT];
 
              if (st)
                {
-                 Real thick = gh_scm2double (st->get_grob_property ("thickness"))
-                   * st->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+                 Real thick = Stem::thickness (st);
 
                  note_head_width -= thick;
                }
            }
 
          correction = note_head_width* stem_dirs[LEFT];
-         correction *= gh_scm2double (me->get_grob_property ("knee-spacing-correction"));
+         correction *= robust_scm2double (me->get_grob_property ("knee-spacing-correction"), 0);
          *fixed += correction;
        }
       else
        {
          intersect = stem_posns[LEFT];  
          intersect.intersect(stem_posns[RIGHT]);
-         correct_stem_dirs = correct_stem_dirs && !intersect.empty_b ();
+         correct_stem_dirs = correct_stem_dirs && !intersect.is_empty ();
 
          if (correct_stem_dirs)
            {
@@ -383,10 +382,10 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
              correction = (correction/7) <? 1.0;
              correction *= stem_dirs[LEFT] ;
              correction *=
-               gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+               robust_scm2double (me->get_grob_property ("stem-spacing-correction"), 0);
            }
          
-         if (!bar_yextent.empty_b())
+         if (!bar_yextent.is_empty ())
            {
              correction *= 0.5;
            }
@@ -416,14 +415,14 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
       
       Interval hp = head_posns[LEFT];
       hp.intersect  (head_posns[RIGHT]);
-      if (!hp.empty_b())
+      if (!hp.is_empty ())
        return ;
 
       Direction lowest =
        (head_posns[LEFT][DOWN] > head_posns[RIGHT][UP]) ? RIGHT : LEFT;
 
       Real delta = head_posns[-lowest][DOWN] - head_posns[lowest][UP] ;
-      Real corr = gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
+      Real corr = robust_scm2double (me->get_grob_property ("stem-spacing-correction"), 0);
       corr =  (delta <= 1) ? 0.0 : 0.25;
       
       correction=  -lowest * corr ;
@@ -431,11 +430,9 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
 
   *space += correction;
 
-#if 0
   /* there used to be a correction for bar_xextent() here, but
      it's unclear what that was good for ?
   */
-#endif
 
 }