- return b.get_curve ();
-}
-
-#if 0
-
-/*
- TODO: FIXME.
- */
-
-/*
- Clipping
-
- This function tries to address two issues:
- * the tangents of the slur should always point inwards
- in the actual slur, i.e. *after rotating back*.
-
- * slurs shouldn't be too high
- let's try : h <= 1.2 b && h <= 3 staffheight?
-
- We could calculate the tangent of the bezier curve from
- both ends going inward, and clip the slur at the point
- where the tangent (after rotation) points up (or inward
- with a certain maximum angle).
-
- However, we assume that real clipping is not the best
- answer. We expect that moving the outer control point up
- if the slur becomes too high will result in a nicer slur
- after recalculation.
-
- Knowing that the tangent is the line through the first
- two control points, we'll clip (move the outer control
- point upwards) too if the tangent points outwards.
- */
-
-bool
-Bezier_Tie::calc_clipping ()
-{
- Real clip_height = paper_l_->get_var ("slur_clip_height");
- Real clip_ratio = paper_l_->get_var ("slur_clip_ratio");
- Real clip_angle = paper_l_->get_var ("slur_clip_angle");
-
- Real b = curve_.control_[3][X_AXIS] - curve_.control_[0][X_AXIS];
- Real clip_h = clip_ratio * b <? clip_height;
- Real begin_h = curve_.control_[1][Y_AXIS] - curve_.control_[0][Y_AXIS];
- Real end_h = curve_.control_[2][Y_AXIS] - curve_.control_[3][Y_AXIS];
- Real begin_dy = 0 >? begin_h - clip_h;
- Real end_dy = 0 >? end_h - clip_h;
-
- Real pi = M_PI;
- Real begin_alpha = (curve_.control_[1] - curve_.control_[0]).arg () + dir_ * alpha_;
- Real end_alpha = pi - (curve_.control_[2] - curve_.control_[3]).arg () - dir_ * alpha_;
-
- Real max_alpha = clip_angle / 90 * pi / 2;
- if ((begin_dy < 0) && (end_dy < 0)
- && (begin_alpha < max_alpha) && (end_alpha < max_alpha))
- return false;