We are using QCustomPlot 2.0.1 for our customers and are quite satisfied with its functionality.

But today we had an issue, that we couldn't resolve. We just wanted to draw a vertical Line inside the QCPAxisRect, that should display the current x value.

For this we are using QCPItemStraightLine together with the clipping option to QCPAxisRect. This works fine for the smallest x values and all x values somewhere in the middle. But, it fails for the largest x value.
Seemingly, there is a problem in a just one pixel to small clipping rectangle?

Is this a known bug or a desired feature? What can I do to correctly display the vertical line in case of a largest x value?

	mPlot = new QCustomPlot;
	mPlot->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
	mPlot->setSelectionRectMode(QCP::SelectionRectMode::srmZoom);
	setLayout(new QVBoxLayout);
	layout()->addWidget(mPlot);
	auto layout = mPlot->plotLayout();
	layout->clear();
	auto rect1 = new QCPAxisRect(mPlot);
	layout->addElement(rect1);

	{
		QVector<double> x;
		QVector<double> y;
		for (auto i = -300; i <= 300; i++) {
			x.push_back(i / 100.);
			y.push_back(std::erf(i / 100.));
		}
		auto graph1 = new QCPCurve(rect1->axis(QCPAxis::atBottom, 0), rect1->axis(QCPAxis::atLeft, 0));
		graph1->setData(x, y);
		graph1->setPen(QPen(QColor("#ff00ff")));
	}


	mPlot->rescaleAxes();

	{ // Works as desired
		auto marker = new QCPItemStraightLine(mPlot);
		QPen p;
		p.setWidth(0);
		p.setColor("red");
		marker->setPen(p);
		marker->setClipAxisRect(rect1);
		marker->setClipToAxisRect(true);
		marker->point1->setCoords(-3, -1);
		marker->point2->setCoords(-3, 1);
	}


	{ // Invisible, but should be visible
		auto marker = new QCPItemStraightLine(mPlot);
		QPen p;
		p.setWidth(0);
		p.setColor("red");
		marker->setPen(p);
		marker->setClipAxisRect(rect1);
		marker->setClipToAxisRect(true);
		marker->point1->setCoords(3, -1);
		marker->point2->setCoords(3, 1);
	}
	{ // Visible, but draws outside of QCPAxisRect
		auto marker = new QCPItemStraightLine(mPlot);
		QPen p;
		p.setWidth(0);
		p.setStyle(Qt::PenStyle::DashDotLine);
		p.setColor("blue");
		marker->setPen(p);
		marker->setClipAxisRect(rect1);
		marker->setClipToAxisRect(false);
		marker->point1->setCoords(3, -1);
		marker->point2->setCoords(3, 1);
	}