Mercurial > hg > octave-avbm
changeset 13473:ba1f40c33359
The higher the zoom, the more precise is the scrolling.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Wed, 20 Apr 2011 10:57:58 +0200 |
parents | 5dcf3331f2a6 |
children | 3b7573c783cc |
files | gui/src/Plot2dWidget.cpp |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/Plot2dWidget.cpp +++ b/gui/src/Plot2dWidget.cpp @@ -98,8 +98,8 @@ void Plot2dView::mouseMoveEvent(QMouseEvent *mouseEvent) { if(m_leftMouseButtonDown) { - m_scrollX -= ((double)mouseEvent->x() - m_lastMouseButtonDownX) / 100; - m_scrollY += ((double)mouseEvent->y() - m_lastMouseButtonDownY) / 100; + m_scrollX -= ((double)mouseEvent->x() - m_lastMouseButtonDownX) / (100 * m_zoom); + m_scrollY += ((double)mouseEvent->y() - m_lastMouseButtonDownY) / (100 * m_zoom); m_lastMouseButtonDownX = (double)mouseEvent->x(); m_lastMouseButtonDownY = (double)mouseEvent->y(); }