]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.41
authorfred <fred>
Tue, 26 Mar 2002 23:10:24 +0000 (23:10 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:10:24 +0000 (23:10 +0000)
lily/axis-group-engraver.cc
lily/score-element.cc

index d6f881d6fc2d26ad0483d784965cd51a8882ff69..5da70fe929da72be8d6637c603c72b1ec9de48c0 100644 (file)
@@ -37,8 +37,8 @@ Axis_group_engraver::get_spanner_p () const
 void
 Axis_group_engraver::do_removal_processing ()
 {
-  String name   = daddy_grav_l ()->type_str_ + "VerticalExtent";
-  SCM dims = get_property (name);
+  String type = daddy_grav_l ()->type_str_ ;
+  SCM dims = get_property (type  + "VerticalExtent");
   
   if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
       && gh_number_p (gh_cdr (dims)))
@@ -46,6 +46,17 @@ Axis_group_engraver::do_removal_processing ()
       staffline_p_->dim_cache_[Y_AXIS]->set_extent_callback (&Score_element::preset_extent);
       staffline_p_->set_elt_property ("extent-Y", dims);
     }
+
+  dims = get_property (type + "MinimumVerticalExtent");
+  if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
+      && gh_number_p (gh_cdr (dims)))
+    staffline_p_->set_elt_property ("minimum-extent-Y", dims);
+
+  dims = get_property (type + "ExtraVerticalExtent");
+  if (gh_pair_p (dims) && gh_number_p (gh_car (dims))
+      && gh_number_p (gh_cdr (dims)))
+    staffline_p_->set_elt_property ("extra-extent-Y", dims);
+
   
   staffline_p_->set_bound(RIGHT,get_staff_info().command_pcol_l ());
   typeset_element (staffline_p_);
index 342270343cf79fec7cf77f165d2ea804e6a51ed1..8da3d235a0d6d87c3128190dc61ad2d122581f2e 100644 (file)
@@ -510,8 +510,34 @@ Interval
 Score_element::extent (Axis a) const
 {
   Dimension_cache const * d = dim_cache_[a];
+  Interval ext = d->get_dim ();
 
-  return d->get_dim ();
+  
+  SCM extra = get_elt_property (a == X_AXIS ? "extra-extent-X"
+                               : "extra-extent-Y");
+
+
+  /*
+    signs ?
+   */
+  Real s = paper_l ()->get_var ("staffspace");
+  if (gh_pair_p (extra))
+    {
+      ext[BIGGER] +=  s * gh_scm2double (gh_cdr (extra));
+      ext[SMALLER] +=  s * gh_scm2double (gh_car (extra));
+    }
+  
+  extra = get_elt_property (a == X_AXIS
+                               ? "minimum-extent-X"
+                               : "minimum-extent-Y");
+  if (gh_pair_p (extra))
+    {
+      ext.unite (Interval (s * gh_scm2double (gh_car (extra)),
+                          s * gh_scm2double (gh_cdr (extra))));
+
+    }
+  
+  return ext;
 }