X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fgrob.cc;h=fbb4683f4a7f2173c1d9e70b2afe7d86db73cd20;hb=7f30590b4e9d2e2e2da747a65258f14279f610e1;hp=13d2e8961583918b59020f2bf5f33f274a9eb1aa;hpb=ade2bb7da653fbd9d670590afd67376fe69c59dd;p=lilypond.git diff --git a/lily/grob.cc b/lily/grob.cc index 13d2e89615..fbb4683f4a 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -288,16 +288,23 @@ Grob::pure_relative_y_coordinate (Grob const *refp, int start, int end) Real off = 0; if (dim_cache_[Y_AXIS].offset_) - off = *dim_cache_[Y_AXIS].offset_; + { + if (to_boolean (get_property ("pure-Y-offset-in-progress"))) + programming_error ("cyclic chain in pure-Y-offset callbacks"); + + off = *dim_cache_[Y_AXIS].offset_; + } else { SCM proc = get_property_data ("Y-offset"); dim_cache_[Y_AXIS].offset_ = new Real (0.0); + set_property ("pure-Y-offset-in-progress", SCM_BOOL_T); off = robust_scm2double (call_pure_function (proc, scm_list_1 (self_scm ()), start, end), 0.0); + del_property ("pure-Y-offset-in-progress"); delete dim_cache_[Y_AXIS].offset_; dim_cache_[Y_AXIS].offset_ = 0; } @@ -433,7 +440,8 @@ Grob::pure_height (Grob *refp, int start, int end) if (!iv.is_empty () && is_number_pair (min_ext)) iv.unite (ly_scm2interval (min_ext)); - iv.translate (offset); + if (!iv.is_empty ()) + iv.translate (offset); return iv; } @@ -446,7 +454,7 @@ Grob::maybe_pure_extent (Grob *refp, Axis a, bool pure, int start, int end) } Interval_t -Grob::spanned_rank_iv () const +Grob::spanned_rank_interval () const { return Interval_t (-1, 0); } @@ -613,6 +621,7 @@ ADD_INTERFACE (Grob, "before-line-breaking " "cause " "color " + "cross-staff " "extra-X-extent " "extra-Y-extent " "extra-offset " @@ -624,6 +633,7 @@ ADD_INTERFACE (Grob, "outside-staff-horizontal-padding " "outside-staff-padding " "outside-staff-priority " + "pure-Y-offset-in-progress " "rotation " "springs-and-rods " "staff-symbol "