-/*
- Piano pedal brackets are a special case of a text spanner.
- Pedal up-down (restart) indicated by the angled right and left edges
- of consecutive pedals touching exactly to form an __/\__
- Chris Jackson <chris@fluffhouse.org.uk>
-
- TODO: Pedal line extending to the end of the note
-*/
-
-void
-Text_spanner::setup_pedal_bracket(Spanner *s)
-{
-
- Real thick = s->paper_l ()->get_var ("stafflinethickness");
- Real ss = Staff_symbol_referencer::staff_space (s);
-
- Drul_array<bool> a, broken;
- Drul_array<Real> height, width, shorten, r;
-
- // Pedal has an angled left edge \__ or an angled right edge __/
- a[LEFT] = a[RIGHT] = false;
- SCM al = s->get_grob_property ("angle-left");
- SCM ar = s->get_grob_property ("angle-right");
- if (gh_boolean_p (al) )
- a[LEFT] = to_boolean (al);
- if (gh_boolean_p (ar) )
- a[RIGHT] = to_boolean (ar);
-
- height[LEFT] = ( to_boolean (s->get_grob_property ("text-start")) ?
- 0 :
- ss );
- height[RIGHT] = ss;
-
- Direction d = LEFT;
- Interval e;
- Real padding = 0;
- SCM pa = (s->get_grob_property ("if-text-padding"));
- if (gh_number_p (pa) )
- padding = gh_scm2double (pa);
- do {
- Item *b = s->get_bound (d);
-
- e = b->extent (b, X_AXIS);
- if (!e.empty_b ())
- r[d] = d * (e[-d] + padding);
-
- broken[d] = b->break_status_dir () != CENTER;
- width[d] = (a[d] ? ss*d/2 : 0);
- if (broken[d])
- height[d] = 0;
+ Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edge-height"),
+ Interval (0.0, 0.0));
+ Drul_array<Stencil> edge_line;
+ {
+ Direction d = LEFT;
+ int dir = to_dir (me->get_property ("direction"));
+ do
+ {
+ if (broken[d])
+ continue;
+
+ Real dx = 0.0;
+ if (is_number_pair (flare))
+ dx = scm_to_double (index_get_cell (flare, d)) * d;
+
+ Real dy = -dir * edge_height[d];
+ if (dy)
+ edge_line[d] = Line_spanner::line_stencil (me, Offset (0, 0), Offset (dx, dy));
+ }
+ while (flip (&d) != LEFT);