Iam using mouse wheel to zoom my view,I have a condition not to zoom out scene below original.
But when i zoom out to original size I dont see original size ,some part is not visible in view port.

When I debugged I found that if I zoom out from a zoomed scene ,just before it reaches scene's original size
my factor becomes 0.9999 so my condition fails and it doesn't zoom out anymore.

Can anybody point our for me if I am doing something wrong here.

Qt Code:
  1. void MyView::wheelEvent(QWheelEvent* event)
  2. {
  3.  
  4. qreal delta=pow((double)2,(event->delta())/ 120.0);
  5. qreal factor = matrix().scale(delta, delta).mapRect(QRectF(0, 0, 1, 1)).width();
  6.  
  7. if (factor < 1.000 || factor > 100)
  8. return;
  9.  
  10. this->scale(delta,delta);
  11. }
To copy to clipboard, switch view to plain text mode