From f270fa5302a3d084f8f0a897403efca46f2e15ec Mon Sep 17 00:00:00 2001 From: Valentin Villenave Date: Sun, 13 Jan 2008 19:01:45 +0100 Subject: [PATCH] fix input regression cluster cross-staff.ly --- lily/cluster.cc | 12 ++++++++++++ lily/include/cluster.hh | 1 + scm/define-grobs.scm | 1 + 3 files changed, 14 insertions(+) diff --git a/lily/cluster.cc b/lily/cluster.cc index 7a84195493..c4b11b38c5 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -111,6 +111,18 @@ brew_cluster_piece (Grob *me, vector bottom_points, vector top_p return out; } +MAKE_SCHEME_CALLBACK (Cluster, calc_cross_staff, 1); +SCM +Cluster::calc_cross_staff (SCM smob) +{ + Grob *me = unsmob_grob (smob); + + extract_grob_set (me, "columns", cols); + Grob *commony = common_refpoint_of_array (cols, me, Y_AXIS); + + return scm_from_bool (commony != me->get_parent (Y_AXIS)); +} + MAKE_SCHEME_CALLBACK (Cluster, print, 1); SCM Cluster::print (SCM smob) diff --git a/lily/include/cluster.hh b/lily/include/cluster.hh index 3081b1b093..e15d002414 100644 --- a/lily/include/cluster.hh +++ b/lily/include/cluster.hh @@ -16,6 +16,7 @@ class Cluster { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); + DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM)); DECLARE_GROB_INTERFACE(); }; diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 800362eb92..658d2dfeb0 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -486,6 +486,7 @@ (stencil . ,ly:cluster::print) (minimum-length . 0.0) (padding . 0.25) + (cross-staff . ,ly:cluster::calc-cross-staff) (style . ramp) (meta . ((class . Spanner) (interfaces . (cluster-interface)))))) -- 2.39.2