]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/side-position-interface.cc
Issue 2515: staff_radius fixes
[lilypond.git] / lily / side-position-interface.cc
index 24422de6fd335094a44c27b26841ac8c105e5988..6fad89ea54cccf0e5846d69d35e90d6e0ff391c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -58,7 +58,6 @@ finish_offset (Grob *me, Direction dir, Real total_off, Real *current_offset)
       && total_off * dir < minimum_space)
     total_off = minimum_space * dir;
 
-
   if (current_offset)
     total_off = dir * max (dir * total_off,
                            dir * (*current_offset));
@@ -174,7 +173,6 @@ Side_position_interface::skyline_side_position (Grob *me, Axis a,
   Direction dir = get_grob_direction (me);
 
   Box off;
-  Real my_min_h = dir == LEFT ? -infinity_f : infinity_f;
   for (Axis ax = X_AXIS; ax < NO_AXES; incr (ax))
     {
       if (ax == a)
@@ -187,12 +185,9 @@ Side_position_interface::skyline_side_position (Grob *me, Axis a,
   if (off[X_AXIS].is_empty () || off[Y_AXIS].is_empty ())
     return scm_from_double (0.0);
 
-  my_min_h = off[a][dir];
-
   Real skyline_padding = 0.1;
 
   Skyline my_dim (off, skyline_padding, other_axis (a), -dir);
-  my_dim.set_minimum_height (my_min_h);
 
   bool include_staff
     = staff_symbol
@@ -354,7 +349,9 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
           Real rounded = directed_round (position, dir);
           Grob *head = me->get_parent (X_AXIS);
 
-          if (fabs (position) <= 2 * Staff_symbol_referencer::staff_radius (me) + 1
+          Interval staff_span = Staff_symbol::line_span (staff);
+          staff_span.widen (1);
+          if (staff_span.contains (position)
               /* In case of a ledger lines, quantize even if we're outside the staff. */
               || (Note_head::has_interface (head)