use of com.xenoage.utils.math.VSide in project Zong by Xenoage.
the class SlurStamper method createForSingleSystem.
/**
* Creates a {@link SlurStamping} for a curved line that
* uses only a single system. The slur may span over multiple staves.
*/
SlurStamping createForSingleSystem(SlurCache slurCache) {
Slur slur = slurCache.getSlur();
SlurWaypoint wp1 = slur.getStart();
SlurWaypoint wp2 = slur.getStop();
// end points of the bezier curve
VSide side = slurCache.getSide();
SP p1 = computeEndPoint(slur, slurCache.getDefaultStartSp(), wp1.getBezierPoint());
SP p2 = computeEndPoint(slur, slurCache.getDefaultStopSp(), wp2.getBezierPoint());
// control points of the bezier curve
BezierPoint b1 = wp1.getBezierPoint();
BezierPoint b2 = wp2.getBezierPoint();
SP c1 = (// custom formatting
b1 != null && b1.getControl() != null ? // custom formatting
b1.getControl() : // default formatting
computeLeftControlPoint(slur, p1, p2, slurCache.getStartStaff()));
SP c2 = (// custom formatting
b2 != null && b2.getControl() != null ? // custom formatting
b2.getControl() : // default formatting
computeRightControlPoint(slur, p1, p2, slurCache.getStopStaff()));
return new SlurStamping(slur, p1, p2, c1, c2, slurCache.getStartStaff(), slurCache.getStopStaff());
}
Aggregations