* lily/dynamic-text-spanner.cc (print): use it.
* lily/grob.cc (robust_relative_extent): new function.
* lily/text-spanner.cc (print): only take linear_combination of
nonempty interval.
2004-08-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/text-spanner.cc (print): use it.
+
+ * lily/dynamic-text-spanner.cc (print): use it.
+
+ * lily/grob.cc (robust_relative_extent): new function.
+
* scripts/lilypond-book.py (main): add -f tex as default process.
* lily/text-spanner.cc (print): only take linear_combination of
}
Interval ext = b->extent (common, X_AXIS);
- span_points[d] = -d * pad +
- (ext.is_empty ())
- ? b->relative_coordinate (common, X_AXIS)
- : ext.linear_combination (encl);
+ span_points[d] = -d * pad
+ + robust_relative_extent (b,common, X_AXIS)
+ .linear_combination (encl);
}
}
while (flip (&d) != LEFT);
return ly_interval2scm (e);
}
+
+Interval
+robust_relative_extent (Grob*me, Grob*refp, Axis a)
+{
+ Interval ext = me->extent (refp, a);
+ if (ext.is_empty())
+ {
+ ext.add_point (me->relative_coordinate (refp, a));
+ }
+
+ return ext;
+}
+
Output_def *
Grob::get_paper () const
{
Link_array<Grob> ly_scm2grobs (SCM ell);
SCM ly_grobs2scm (Link_array<Grob> a);
+Interval robust_relative_extent (Grob*, Grob*, Axis);
+
#endif /* GROB_HH */
Interval ext = b->extent (common, X_AXIS);
span_points[d] =
- (ext.is_empty())
- ? b->relative_coordinate (common, X_AXIS)
- : ext.linear_combination (d * encl);
+ robust_relative_extent (b, common, X_AXIS).linear_combination (d * encl);
if (is_number_pair (shorten))
span_points -= d * ly_scm2double (index_get_cell (shorten, d));