Hi Uwe, I have a rescale copied from the QwtPlotMagnifier class in place. My implementation for ZoomIn and ZoomOut are as follows. My intention was to keep a scale factor, and basically change by 10% for zoom in/out. What I am noticing in practice with this approach, is that the zoom does not behave as I would expect. For example, if I zoom in 4 times, and zoom out 4 times, I am not often back to where I begin. This is exclusive of the zoom rectangle implementation. Perhaps this approach is not the best. Any thoughts on improving this approach?
void Plot::zoomIn()
{
m_scaleFactor -= .1;
if (m_scaleFactor < 0)
m_scaleFactor = 0;
rescale(m_scaleFactor);
}
void Plot::zoomOut()
{
m_scaleFactor += .1;
//if (m_scaleFactor > 1.0)
// m_scaleFactor = 1.0;
rescale(m_scaleFactor);
}
void Plot::zoomIn()
{
m_scaleFactor -= .1;
if (m_scaleFactor < 0)
m_scaleFactor = 0;
rescale(m_scaleFactor);
}
void Plot::zoomOut()
{
m_scaleFactor += .1;
//if (m_scaleFactor > 1.0)
// m_scaleFactor = 1.0;
rescale(m_scaleFactor);
}
To copy to clipboard, switch view to plain text mode
Bookmarks