]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/side-position-interface.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / side-position-interface.cc
index 2352c116d08ae37c9adb54c953734f037e786e32..4964c475727014e80f3795faaaa438ef1288786c 100644 (file)
@@ -14,8 +14,7 @@ using namespace std;
 
 #include "note-head.hh"
 #include "warn.hh"
-#include "warn.hh"
-#include "dimensions.hh"
+#include "main.hh"
 #include "staff-symbol-referencer.hh"
 #include "pointer-group-interface.hh"
 #include "directional-element-interface.hh"
@@ -27,7 +26,7 @@ using namespace std;
 void
 Side_position_interface::add_support (Grob *me, Grob *e)
 {
-  Pointer_group_interface::add_grob (me, ly_symbol2scm ("side-support-elements"), e);
+  Pointer_group_interface::add_unordered_grob (me, ly_symbol2scm ("side-support-elements"), e);
 }
 
 Direction
@@ -107,17 +106,19 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten
   if (fabs (total_off) > 1000)
     {
       string msg
-       = String_convert::form_string ("Improbable offset for grob %s: %f%s",
-                                      me->name ().c_str (), total_off,
-                                      INTERNAL_UNIT);
+       = String_convert::form_string ("Improbable offset for grob %s: %f",
+                                      me->name ().c_str (), total_off);
 
       programming_error (msg);
+      if (strict_infinity_checking)
+       scm_misc_error (__FUNCTION__, "Improbable offset.", SCM_EOL);
     }
   return scm_from_double (total_off);
 }
 
 
 MAKE_SCHEME_CALLBACK (Side_position_interface, y_aligned_on_support_refpoints, 1);
+
 SCM
 Side_position_interface::y_aligned_on_support_refpoints (SCM smob)
 {
@@ -179,8 +180,8 @@ Side_position_interface::aligned_side (Grob *me, Axis a)
          Real position = 2 * (my_off + o - staff_off) / ss;
          Real rounded = directed_round (position, dir);
          Grob *head = me->get_parent (X_AXIS);
-      
-         if (rounded <= 2 * Staff_symbol_referencer::staff_radius (me) 
+
+         if (fabs (position) <= 2 * Staff_symbol_referencer::staff_radius (me) + 1 
              || (Note_head::has_interface (head)
                  && sign (Staff_symbol_referencer::get_position (head)) == - dir))
            {
@@ -240,10 +241,10 @@ ADD_INTERFACE (Side_position_interface, "side-position-interface",
               "direction-source "
               "minimum-space "
               "padding "
+              "quantize-position "
               "side-axis "
               "side-relative-direction "
               "side-support-elements "
               "slur-padding "
               "staff-padding "
-              "quantize-position "
               );