if (leftContY > lastY && leftContY > plotY) {
                leftContY = mathMax(lastY, plotY);
                rightContY = 2 * plotY - leftContY; // mirror of left control point
            } else if (leftContY < lastY && leftContY < plotY) {
                leftContY = mathMin(lastY, plotY);