/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2011 Jan Nieuwenhuizen <janneke@gnu.org>
+ Copyright (C) 1997--2012 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
*/
#include "tuplet-bracket.hh"
+#include "axis-group-interface.hh"
#include "line-interface.hh"
#include "beam.hh"
#include "warn.hh"
Direction d = LEFT;
do
{
- x_span[d] = robust_relative_extent (bounds[d], commonx, X_AXIS)[d];
-
+ x_span[d] = bounds[d]->break_status_dir ()
+ ? Axis_group_interface::generic_bound_extent (bounds[d], commonx, X_AXIS)[d]
+ : robust_relative_extent (bounds[d], commonx, X_AXIS)[d];
if (connect_to_other[d])
{
Interval overshoot (robust_scm2drul (me->get_property ("break-overshoot"),
if (d == RIGHT)
x_span[d] += d * overshoot[d];
else
- x_span[d] = robust_relative_extent (bounds[d],
- commonx, X_AXIS)[RIGHT]
+ x_span[d] = (bounds[d]->break_status_dir ()
+ ? Axis_group_interface::generic_bound_extent (bounds[d], commonx, X_AXIS)[-d]
+ : robust_relative_extent (bounds[d], commonx, X_AXIS)[-d])
- overshoot[LEFT];
}
Grob *number = unsmob_grob (tuplets[i]->get_object ("tuplet-number"));
if (number)
points.push_back (Offset (number->extent (commonx, X_AXIS).center () - x0,
- number->extent (commony, Y_AXIS)[dir]));
+ number->extent (commony, Y_AXIS)[dir]));
+ }
+
+ if (to_boolean (me->get_property ("avoid-scripts"))
+ && !scm_is_number (me->get_property ("outside-staff-priority")))
+ {
+ extract_grob_set (me, "scripts", scripts);
+ for (vsize i = 0; i < scripts.size (); i++)
+ {
+ if (!scripts[i]->is_live ())
+ continue;
+ if (scm_is_number (scripts[i]->get_property ("outside-staff-priority")))
+ continue;
+
+ Interval script_x (scripts[i]->extent (commonx, X_AXIS));
+ Interval script_y (scripts[i]->extent (commony, Y_AXIS));
+
+ points.push_back (Offset (script_x.center () - x0,
+ script_y[dir]));
+ }
}
*offset = -dir * infinity_f;
add_bound_item (dynamic_cast<Spanner *> (me), n);
}
+void
+Tuplet_bracket::add_script (Grob *me, Item *s)
+{
+ Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), s);
+}
+
void
Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket)
{
" @code{edge-text} are printed at the edges.",
/* properties */
+ "avoid-scripts "
"bracket-flare "
"bracket-visibility "
"break-overshoot "