QCustomPlot Discussion and Comments

Bug when zoomingReturn to overview

Hi,

There is a bug when zooming on a QCPCurve polygone,
the edges are sometimes moving, it is quiet difficult to explain this,
I should post my exe file to show this bug.
This occurs only with a polygone where one angle is less than 90 degree
and zooming on it :

Here the code to draw this polygone:

path = new QCPCurve(customPlot->xAxis, customPlot->yAxis);
QVector<double> x1, y1;
x1 << 10<< 5 << -5 << -5 << 10;
y1 << 10<< -5 << -5 << 5 << 10;

customPlot->addPlottable(path);

path->setData(x1,y1);
path->setPen(QPen(Qt::green));

Then zoom on the vertex located at (10,10) then move the vertex
ouside the graph view, you will see the two edges moving on a wrong way.
More you are zooming more the edges are moving.

Hi,
That's a known limitation of the current QCPCurve optimization algorithm, when zooming into an edge or vertex very far. Currently, the only solution is to add more points to the curve. I will implement a different (faster, and without this problem) algorithm in a future version, but I can't yet say which release version it will be.