summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Morris <paulwmorris@gmail.com>2015-12-15 22:58:39 -0500
committerJames Lowe <pkx166h@gmail.com>2015-12-23 16:08:59 +0000
commite8c64d368204178e5ac19ef9b62071e72f08b49b (patch)
treefc2484a8dd29aecafcbf7925d9aba1b9b4d4cac0
parentbac468879918a22fe1237957d7818bad27313eb8 (diff)
Add ly:grob-spanned-rank-interval
-rw-r--r--lily/grob-scheme.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc
index 1a316b7ae1..572a49ac84 100644
--- a/lily/grob-scheme.cc
+++ b/lily/grob-scheme.cc
@@ -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]));
+}