From: Dan Eble Date: Mon, 3 Aug 2015 13:27:21 +0000 (-0400) Subject: Issue 4540: Rename Grob::pure_height() to pure_y_extent() to avoid X-Git-Tag: release/2.19.26-1~50 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ef18cc27b8103c2f1ce50924ecf55b66fa6b746a;p=lilypond.git Issue 4540: Rename Grob::pure_height() to pure_y_extent() to avoid ambiguity with pure_height() callbacks in many grob-interface classes. This is preparatory to deriving the interface classes from Grob. --- diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 3555435bea..32eb54fac7 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -371,7 +371,7 @@ build_heads_skyline (vector const &heads_and_stems, vector head_extents; for (vsize i = heads_and_stems.size (); i--;) head_extents.push_back (Box (heads_and_stems[i]->extent (common[X_AXIS], X_AXIS), - heads_and_stems[i]->pure_height (common[Y_AXIS], 0, INT_MAX))); + heads_and_stems[i]->pure_y_extent (common[Y_AXIS], 0, INT_MAX))); return Skyline (head_extents, Y_AXIS, LEFT); } diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 32eb1edace..0c140235dc 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -93,7 +93,7 @@ get_skylines (Grob *g, else { assert (a == Y_AXIS); - Interval extent = g->pure_height (g, start, end); + Interval extent = g->pure_y_extent (g, start, end); // This is a hack to get better accuracy on the pure-height of VerticalAlignment. // It's quite common for a treble clef to be the highest element of one system diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 59d1d6ba24..4aad5860c7 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -284,7 +284,7 @@ Axis_group_interface::adjacent_pure_heights (SCM smob) if (g->pure_is_visible (start, visibility_end)) { - Interval dims = g->pure_height (common, start, end); + Interval dims = g->pure_y_extent (common, start, end); if (!dims.is_empty ()) { if (rank_span[LEFT] <= start) @@ -346,7 +346,7 @@ Axis_group_interface::relative_pure_height (Grob *me, int start, int end) && !(to_boolean (g->get_property ("cross-staff")) && Stem::has_interface (g))) { - Interval dims = g->pure_height (common, start, end); + Interval dims = g->pure_y_extent (common, start, end); if (!dims.is_empty ()) r.unite (dims); } diff --git a/lily/flag.cc b/lily/flag.cc index 1e1ba55ffe..7333bf299f 100644 --- a/lily/flag.cc +++ b/lily/flag.cc @@ -187,7 +187,7 @@ Flag::internal_calc_y_offset (SCM smob, bool pure) = me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter")); Interval stem_extent = pure - ? stem->pure_height (stem, 0, INT_MAX) + ? stem->pure_y_extent (stem, 0, INT_MAX) : stem->extent (stem, Y_AXIS); return scm_from_double (stem_extent.is_empty () diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index b6d07cb8c4..0924b0a58d 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -120,7 +120,7 @@ LY_DEFINE (ly_grob_pure_height, "ly:grob-pure-height", if (SCM_UNBNDP (val)) val = SCM_EOL; - Interval retval = sc->pure_height (ref, scm_to_int (beg), scm_to_int (end)); + Interval retval = sc->pure_y_extent (ref, scm_to_int (beg), scm_to_int (end)); return ly_interval2scm (retval); } diff --git a/lily/grob.cc b/lily/grob.cc index d5dcf6794d..83b78edac4 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -496,7 +496,7 @@ Grob::extent (Grob *refp, Axis a) const } Interval -Grob::pure_height (Grob *refp, int start, int end) +Grob::pure_y_extent (Grob *refp, int start, int end) { SCM iv_scm = get_pure_property ("Y-extent", start, end); Interval iv = robust_scm2interval (iv_scm, Interval ()); @@ -518,7 +518,7 @@ Grob::pure_height (Grob *refp, int start, int end) Interval Grob::maybe_pure_extent (Grob *refp, Axis a, bool pure, int start, int end) { - return (pure && a == Y_AXIS) ? pure_height (refp, start, end) : extent (refp, a); + return (pure && a == Y_AXIS) ? pure_y_extent (refp, start, end) : extent (refp, a); } Interval_t diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 819c86c287..8b2c4249ea 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -148,7 +148,7 @@ public: /* extents */ Interval extent (Grob *refpoint, Axis) const; void flush_extent_cache (Axis); - virtual Interval pure_height (Grob *refpoint, int start_col, int end_col); + virtual Interval pure_y_extent (Grob *refpoint, int start, int end); Interval maybe_pure_extent (Grob *refpoint, Axis, bool pure, int start, int end); /* refpoints */ diff --git a/lily/include/item.hh b/lily/include/item.hh index 3b13ed8477..e987d89bca 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -52,7 +52,7 @@ public: virtual Paper_column *get_column () const; virtual void handle_prebroken_dependencies (); virtual Interval_t spanned_rank_interval () const; - virtual Interval pure_height (Grob *ref, int start, int end); + virtual Interval pure_y_extent (Grob *ref, int start, int end); virtual void cache_pure_height (Interval height); DECLARE_GROB_INTERFACE (); protected: diff --git a/lily/item.cc b/lily/item.cc index 220176e55b..f90b29d30a 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -224,7 +224,7 @@ Item::derived_mark () const } Interval -Item::pure_height (Grob *g, int start, int end) +Item::pure_y_extent (Grob *g, int start, int end) { if (cached_pure_height_valid_) return cached_pure_height_ + pure_relative_y_coordinate (g, start, end); @@ -232,7 +232,7 @@ Item::pure_height (Grob *g, int start, int end) assuming that Items' pure_heights do not depend on 'start' or 'end'. */ - cache_pure_height (Grob::pure_height (this, start, end)); + cache_pure_height (Grob::pure_y_extent (this, start, end)); return cached_pure_height_ + pure_relative_y_coordinate (g, start, end); } diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index fcd1523d2f..91859fb6ec 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -265,7 +265,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, if (!hp.is_empty ()) { Real ss = Staff_symbol_referencer::staff_space (stem); - stem_posns[d] = stem->pure_height (stem, 0, INT_MAX) * (2 / ss); + stem_posns[d] = stem->pure_y_extent (stem, 0, INT_MAX) * (2 / ss); head_posns[d].unite (hp); } } diff --git a/lily/separation-item.cc b/lily/separation-item.cc index d0cad83d8e..01490fa1a0 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -157,7 +157,7 @@ Separation_item::boxes (Grob *me, Grob *left) && !Note_head::has_interface (il)) continue; - Interval y (il->pure_height (ycommon, 0, very_large)); + Interval y (il->pure_y_extent (ycommon, 0, very_large)); Interval x (il->extent (pc, X_AXIS)); Interval extra_width = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"), diff --git a/lily/slur.cc b/lily/slur.cc index 93f5492b66..39059a59b6 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -99,7 +99,7 @@ Slur::pure_height (SCM smob, SCM start_scm, SCM end_scm) for (vsize i = 0; i < encompasses.size (); i++) { - Interval d = encompasses[i]->pure_height (parent, start, end); + Interval d = encompasses[i]->pure_y_extent (parent, start, end); if (!d.is_empty ()) { for (DOWN_and_UP (downup)) @@ -271,7 +271,7 @@ Slur::pure_outside_slur_callback (SCM grob, SCM start_scm, SCM end_scm, SCM offs Real offset = robust_scm2double (offset_scm, 0.0); Direction dir = get_grob_direction (script); - return scm_from_double (offset + dir * slur->pure_height (slur, start, end).length () / 4); + return scm_from_double (offset + dir * slur->pure_y_extent (slur, start, end).length () / 4); } MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1, ""); diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index c414268f26..11fb185a87 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -55,7 +55,7 @@ Staff_spacing::optical_correction (Grob *me, Grob *g, Interval bar_height) Direction d = get_grob_direction (stem); if (Stem::is_normal_stem (stem) && d == DOWN) { - Interval stem_posns = stem->pure_height (stem, 0, INT_MAX); + Interval stem_posns = stem->pure_y_extent (stem, 0, INT_MAX); stem_posns.intersect (bar_height); diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 8cb60db078..75d25f43cf 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -172,7 +172,7 @@ Stem_tremolo::pure_height (SCM smob, SCM, SCM) if (!beam) return ly_interval2scm (s1.extent (Y_AXIS)); - Interval ph = stem->pure_height (stem, 0, INT_MAX); + Interval ph = stem->pure_y_extent (stem, 0, INT_MAX); Stem_info si = Stem::get_stem_info (stem); ph[-dir] = si.shortest_y_; int beam_count = Stem::beam_multiplicity (stem).length () + 1; @@ -298,16 +298,16 @@ Stem_tremolo::y_offset (Grob *me, bool pure) if (pure && beam) { - Interval ph = stem->pure_height (stem, 0, INT_MAX); + Interval ph = stem->pure_y_extent (stem, 0, INT_MAX); Stem_info si = Stem::get_stem_info (stem); ph[-dir] = si.shortest_y_; - return (ph - dir * max (beam_count, 1) * beam_translation)[dir] - dir * 0.5 * me->pure_height (me, 0, INT_MAX).length (); + return (ph - dir * max (beam_count, 1) * beam_translation)[dir] - dir * 0.5 * me->pure_y_extent (me, 0, INT_MAX).length (); } Real end_y = (pure - ? stem->pure_height (stem, 0, INT_MAX)[dir] + ? stem->pure_y_extent (stem, 0, INT_MAX)[dir] : stem->extent (stem, Y_AXIS)[dir]) - dir * max (beam_count, 1) * beam_translation - Stem::beam_end_corrective (stem); diff --git a/lily/system.cc b/lily/system.cc index 91e3f08181..a511a32b67 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -450,7 +450,7 @@ System::break_into_pieces (vector const &breaking) int st = Paper_column::get_rank (c[0]); int end = Paper_column::get_rank (c.back ()); - Interval iv (pure_height (this, st, end)); + Interval iv (pure_y_extent (this, st, end)); system->set_property ("pure-Y-extent", ly_interval2scm (iv)); system->set_bound (LEFT, c[0]);