ambiguity with pure_height() callbacks in many grob-interface classes.
This is preparatory to deriving the interface classes from Grob.
15 files changed:
vector<Box> 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),
vector<Box> 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);
}
return Skyline (head_extents, Y_AXIS, LEFT);
}
else
{
assert (a == Y_AXIS);
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
// 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
if (g->pure_is_visible (start, visibility_end))
{
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)
if (!dims.is_empty ())
{
if (rank_span[LEFT] <= start)
&& !(to_boolean (g->get_property ("cross-staff"))
&& Stem::has_interface (g)))
{
&& !(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);
}
if (!dims.is_empty ())
r.unite (dims);
}
= me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"));
Interval stem_extent = 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 ()
: stem->extent (stem, Y_AXIS);
return scm_from_double (stem_extent.is_empty ()
if (SCM_UNBNDP (val))
val = SCM_EOL;
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);
}
return ly_interval2scm (retval);
}
-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 ());
{
SCM iv_scm = get_pure_property ("Y-extent", start, end);
Interval iv = robust_scm2interval (iv_scm, Interval ());
Interval
Grob::maybe_pure_extent (Grob *refp, Axis a, bool pure, 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);
/* extents */
Interval extent (Grob *refpoint, Axis) const;
void flush_extent_cache (Axis);
/* 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 */
Interval maybe_pure_extent (Grob *refpoint, Axis, bool pure, int start, int end);
/* refpoints */
virtual Paper_column *get_column () const;
virtual void handle_prebroken_dependencies ();
virtual Interval_t<int> spanned_rank_interval () const;
virtual Paper_column *get_column () const;
virtual void handle_prebroken_dependencies ();
virtual Interval_t<int> 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:
virtual void cache_pure_height (Interval height);
DECLARE_GROB_INTERFACE ();
protected:
-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);
{
if (cached_pure_height_valid_)
return cached_pure_height_ + pure_relative_y_coordinate (g, start, end);
assuming that Items' pure_heights do not depend on 'start' or '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);
}
return cached_pure_height_ + pure_relative_y_coordinate (g, start, end);
}
if (!hp.is_empty ())
{
Real ss = Staff_symbol_referencer::staff_space (stem);
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);
}
}
head_posns[d].unite (hp);
}
}
&& !Note_head::has_interface (il))
continue;
&& !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"),
Interval x (il->extent (pc, X_AXIS));
Interval extra_width = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"),
for (vsize i = 0; i < encompasses.size (); i++)
{
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))
if (!d.is_empty ())
{
for (DOWN_and_UP (downup))
Real offset = robust_scm2double (offset_scm, 0.0);
Direction dir = get_grob_direction (script);
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, "");
}
MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Slur, outside_slur_callback, 2, 1, "");
Direction d = get_grob_direction (stem);
if (Stem::is_normal_stem (stem) && d == DOWN)
{
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);
stem_posns.intersect (bar_height);
if (!beam)
return ly_interval2scm (s1.extent (Y_AXIS));
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;
Stem_info si = Stem::get_stem_info (stem);
ph[-dir] = si.shortest_y_;
int beam_count = Stem::beam_multiplicity (stem).length () + 1;
- 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_;
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 ();
- ? 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);
: stem->extent (stem, Y_AXIS)[dir])
- dir * max (beam_count, 1) * beam_translation
- Stem::beam_end_corrective (stem);
int st = Paper_column::get_rank (c[0]);
int end = Paper_column::get_rank (c.back ());
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]);
system->set_property ("pure-Y-extent", ly_interval2scm (iv));
system->set_bound (LEFT, c[0]);