-/*
- should move to lookup?
-
- TODO: this will fail for very short (shorter than the flare)
- brackets.
-*/
-Stencil
-Tuplet_bracket::make_bracket (Grob *me, // for line properties.
- Axis protrusion_axis,
- Offset dz,
- Drul_array<Real> height,
- Interval gap,
- Drul_array<Real> flare,
- Drul_array<Real> shorten)
-{
- Drul_array<Offset> corners (Offset (0, 0), dz);
-
- Real length = dz.length ();
- Drul_array<Offset> gap_corners;
-
- Axis bracket_axis = other_axis (protrusion_axis);
-
- Drul_array<Offset> straight_corners = corners;
-
- Direction d = LEFT;
- do
- straight_corners[d] += -d * shorten[d] / length * dz;
- while (flip (&d) != LEFT);
-
- if (!gap.is_empty ())
- {
- do
- gap_corners[d] = (dz * 0.5) + gap[d] / length * dz;
- while (flip (&d) != LEFT);
- }
-
- Drul_array<Offset> flare_corners = straight_corners;
- do
- {
- flare_corners[d][bracket_axis] = straight_corners[d][bracket_axis];
- flare_corners[d][protrusion_axis] += height[d];
- straight_corners[d][bracket_axis] += -d * flare[d];
- }
- while (flip (&d) != LEFT);
-
- Stencil m;
- do
- {
- if (!gap.is_empty ())
- m.add_stencil (Line_interface::line (me, straight_corners[d],
- gap_corners[d]));
-
- m.add_stencil (Line_interface::line (me, straight_corners[d],
- flare_corners[d]));
- }
-
- while (flip (&d) != LEFT);
-
- if (gap.is_empty ())
- m.add_stencil (Line_interface::line (me, straight_corners[LEFT],
- straight_corners[RIGHT]));
-
- return m;
-}
-