if (rightContY > nextY && rightContY > plotY) {
                rightContY = mathMax(nextY, plotY);
                leftContY = 2 * plotY - rightContY;
            } else if (rightContY < nextY && rightContY < plotY) {
                rightContY = mathMin(nextY, plotY);