]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/separation-item.cc
2003 -> 2004
[lilypond.git] / lily / separation-item.cc
index c1822616e49c961e8d32ecd06f1239054174edd4..b3e7c8a368853dff23513410745d41d838e0d056 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -67,11 +67,7 @@ Separation_item::conditional_width (Grob * me, Grob * left)
 
   SCM pad = me->get_grob_property ("padding");
 
-  if (gh_number_p (pad))
-    {
-      w[RIGHT] += gh_scm2double (pad)/2;
-      w[LEFT] -= gh_scm2double (pad)/2;    
-    }
+  w.widen (robust_scm2double (pad, 0.0));
   return w;
 }
 
@@ -116,17 +112,21 @@ Separation_item::width (Grob *me)
 
   SCM pad = me->get_grob_property ("padding");
 
-  if (gh_number_p (pad))
-  {
-    w[RIGHT] += gh_scm2double (pad)/2;
-    w[LEFT] -= gh_scm2double (pad)/2;    
-  }
+  w.widen (robust_scm2double (pad, 0.0));
 
   me->set_grob_property ("X-extent", ly_interval2scm (w));
   
   return w;
 }
 
+Interval
+Separation_item::relative_width (Grob * me, Grob * common)
+{
+  Interval iv = width (me);
+
+  return dynamic_cast<Item*>(me)->get_column ()->relative_coordinate (common, X_AXIS) + iv ;
+}
+
 
 /*
   Try to find the break-aligned symbol in SEPARATION_ITEM that is