compute correct ending point for miter join