changeset 13472:5dcf3331f2a6

Scrolling is very smooth now.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Wed, 20 Apr 2011 10:56:02 +0200
parents 4baf5e6bba13
children ba1f40c33359
files gui/src/Plot2dWidget.cpp
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gui/src/Plot2dWidget.cpp	Wed Apr 20 10:18:02 2011 +0200
+++ b/gui/src/Plot2dWidget.cpp	Wed Apr 20 10:56:02 2011 +0200
@@ -15,6 +15,7 @@
     animationTimer->setInterval(20);
     animationTimer->start();
     m_zoom = 1.0;
+    m_zoomAcceleration = 0.0;
     m_scrollX = 0.0;
     m_scrollY = 0.0;
     m_leftMouseButtonDown = false;
@@ -74,7 +75,7 @@
 }
 
 void Plot2dView::wheelEvent(QWheelEvent *wheelEvent) {
-    m_zoomAcceleration += ((double)wheelEvent->delta()) / 5000;
+    m_zoomAcceleration += ((double)wheelEvent->delta()) / 1000;
     wheelEvent->accept();
     updateGL();
 }
@@ -109,9 +110,9 @@
     m_zoom += m_zoomAcceleration;
     if(m_zoom < 0)
         m_zoom = 0;
-    m_zoomAcceleration *= 0.2;
-    if(abs(m_zoomAcceleration) < 0.01)
-        m_zoomAcceleration = 0;
+    m_zoomAcceleration *= 0.5;
+    //if(abs(m_zoomAcceleration) < 0.001)
+    //    m_zoomAcceleration = 0;
     updateGL();
 }