+ for (int d = LEFT; d <= RIGHT; d++)
+ {
+ Real x = xext.linear_combination ((Direction) d);
+ consider[k] = bezext.contains (x);
+
+ if (consider[k])
+ {
+ ys[k]
+ = (fabs(bezext[LEFT] - x) < EPS)
+ ? curve.control_[0][Y_AXIS]
+ : ((fabs(bezext[RIGHT] - x) < EPS)
+ ? curve.control_[3][Y_AXIS]
+ : curve.get_other_coordinate (X_AXIS, x));
+ consider[k] = true;
+
+ if (yext.contains (ys[k]))
+ do_shift = true;
+ }
+ }
+ Real offset = 0.0;
+ if (do_shift)
+ {
+ k = 0;
+ Direction dir = get_grob_direction (script);
+ for (int d = LEFT; d <= RIGHT; d++)
+ {
+ offset = dir * (dir * offset >? dir
+ * (ys[k] - yext[-dir] + dir * slur_padding));
+ k++;
+ }
+ }