]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
authorJoe Neeman <joeneeman@gmail.com>
Thu, 21 Dec 2006 17:36:26 +0000 (19:36 +0200)
committerJoe Neeman <joeneeman@gmail.com>
Thu, 21 Dec 2006 17:36:26 +0000 (19:36 +0200)
Conflicts:

lily/align-interface.cc

lily/align-interface.cc
lily/include/spanner.hh
lily/spanner.cc

index 690f2a4921d7bd0c97297948364f7848297ac123..58cd7098ccda3385e49e70365db60c0978b24856 100644 (file)
@@ -157,8 +157,10 @@ get_skylines (Grob *me,
       Interval extent = g->maybe_pure_extent (g, a, pure, start, end);
       Interval other_extent = pure ? Interval (-infinity_f, infinity_f)
        : g->extent (common_refpoint, other_axis (a));
-      Box b = (a == X_AXIS) ? Box (extent, other_extent) : Box (other_extent, extent);
-      
+      Box b;
+      b[a] = extent;
+      b[other_axis (a)] = other_extent;
+
       if (extent.is_empty ())
        {
          elements->erase (elements->begin () + i);
index b90d1995168aa92158b6300969299e4f0eb28571..bce4837e016ce002dad8dc45cff04e579a712b82 100644 (file)
@@ -35,6 +35,7 @@ class Spanner : public Grob
 
 public:
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
+  DECLARE_SCHEME_CALLBACK (bounds_width, (SCM));
 
   vector<Spanner*> broken_intos_;
 
index c0ac823b02b5329f8c7991b1f019aca551e1512f..f4909f53b2cd69216b5743d481adb8ea6f657626 100644 (file)
@@ -384,11 +384,30 @@ unsmob_spanner (SCM s)
   return dynamic_cast<Spanner *> (unsmob_grob (s));
 }
 
+MAKE_SCHEME_CALLBACK(Spanner, bounds_width, 1);
+SCM
+Spanner::bounds_width (SCM grob)
+{
+  Spanner *me = unsmob_spanner (grob);
+
+
+  Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
+
+  Interval w (me->get_bound (LEFT)->relative_coordinate (common, X_AXIS),
+             me->get_bound (RIGHT)->relative_coordinate (common, X_AXIS));
+             
+  w -= me->relative_coordinate (common, X_AXIS);
+
+  return ly_interval2scm (w);
+}
+
 ADD_INTERFACE (Spanner,
               "Some objects are horizontally spanned between objects. For\n"
               "example, slur, beam, tie, etc. These grobs form a subtype called\n"
               "@code{Spanner}. All spanners have two span-points (these must be\n"
               "@code{Item} objects), one on the left and one on the right. The left bound is\n"
               "also the X-reference point of the spanner.\n",
-              "minimum-length");
+
+              "minimum-length "
+              );