]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/g-staff-side.cc
patch::: 1.1.37.script1
[lilypond.git] / lily / g-staff-side.cc
index 20812e55ad33b661c37cd42cd5f563cca3758050..db1b29cd69dee8a84838c3529d17aa3bdbe6d711 100644 (file)
@@ -15,25 +15,26 @@ G_staff_side_item::G_staff_side_item ()
   dir_ = CENTER;
   to_position_l_ = 0;
   set_elt_property (transparent_scm_sym, SCM_BOOL_T);
-
+  staff_support_b_ = true;
   axis_ = Y_AXIS;
 }
 
 
+
 void
 G_staff_side_item::do_pre_processing ()
 {
   if (!dir_)
-    set_default_direction ();
+    dir_ = get_default_direction ();
 
   if (axis_ == X_AXIS)
     position_self ();
 }
 
-void
-G_staff_side_item::set_default_direction ()
+Direction
+G_staff_side_item::get_default_direction () const
 {
-  dir_ = DOWN;
+  return DOWN;
 }
 
 
@@ -66,6 +67,7 @@ G_staff_side_item::do_substitute_element_pointer (Score_element*o, Score_element
 void
 G_staff_side_item::position_self ()
 {
+
   Interval dim;
   Dimension_cache *common = 0;
   if (support_l_arr_.size ())
@@ -85,15 +87,21 @@ G_staff_side_item::position_self ()
       dim = Interval(0,0);
       common = dim_cache_[axis_].parent_l_;
     }
-  Interval sym_dim = to_position_l_->extent (axis_);
+
+  
+  Interval sym_dim
+    = to_position_l_
+    ? to_position_l_->extent (axis_)
+    : Interval(0,0);
+
   Real off = dim_cache_[axis_].relative_coordinate (common);
 
-  SCM pad =   remove_elt_property (padding_scm_sym);
+  SCM pad = remove_elt_property (padding_scm_sym);
   if (pad != SCM_BOOL_F)
     {
-      off -= gh_scm2double (SCM_CDR(pad)) * dir_;
+      off += gh_scm2double (SCM_CDR(pad)) * dir_;
     }
-  dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] - off);
+  dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] + off);
 }
 
 void
@@ -107,7 +115,8 @@ G_staff_side_item::do_post_processing ()
 void
 G_staff_side_item::do_add_processing ()
 {
-  if (axis_ == Y_AXIS && staff_symbol_l ())
+  if (staff_support_b_
+      && axis_ == Y_AXIS && staff_symbol_l ())
     {
       add_support (staff_symbol_l ());
     }