]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add ly:grob-spanned-rank-interval
authorPaul Morris <paulwmorris@gmail.com>
Wed, 16 Dec 2015 03:58:39 +0000 (22:58 -0500)
committerJames Lowe <pkx166h@gmail.com>
Wed, 23 Dec 2015 16:08:59 +0000 (16:08 +0000)
lily/grob-scheme.cc

index 1a316b7ae1e3a49a41e80a6bc15bc740e693c68f..572a49ac84afcf788be814ce2a00c2e6c0fde05f 100644 (file)
@@ -480,3 +480,18 @@ LY_DEFINE (ly_grob_get_vertical_axis_group_index, "ly:grob-get-vertical-axis-gro
 
   return scm_from_int (Grob::get_vertical_axis_group_index (gr));
 }
+
+LY_DEFINE (ly_grob_spanned_rank_interval, "ly:grob-spanned-rank-interval",
+           1, 0, 0, (SCM grob),
+           "Returns a pair with the @code{rank} of the furthest left"
+           " column and the @code{rank} of the furthest right column"
+           " spanned by @code{grob}.")
+{
+  Grob *gr = unsmob<Grob> (grob);
+
+  LY_ASSERT_SMOB (Grob, grob, 1);
+
+  Interval_t<int> iv = gr->spanned_rank_interval ();
+
+  return scm_cons (scm_from_int(iv[LEFT]), scm_from_int(iv[RIGHT]));
+}