# HG changeset patch # User Santeri Piippo # Date 1368921329 -10800 # Node ID fddd36a6526c5546aa718033e814460b78c27538 # Parent 1dd18eea7c8494a5fddda84568208d705f7f5cf5 Make zooming more intuitive - use incremental zooming after crossing the 15.0f mark diff -r 1dd18eea7c84 -r fddd36a6526c src/gldraw.cpp --- a/src/gldraw.cpp Sun May 19 02:04:46 2013 +0300 +++ b/src/gldraw.cpp Sun May 19 02:55:29 2013 +0300 @@ -911,14 +911,13 @@ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= void GLRenderer::mousePressEvent (QMouseEvent* ev) { - if (ev->buttons () & Qt::LeftButton) + if (ev->buttons () & Qt::LeftButton && !(m_lastButtons && Qt::LeftButton)) m_totalmove = 0; if (ev->modifiers () & Qt::ShiftModifier) { m_rangepick = true; m_rangeStart.setX (ev->x ()); m_rangeStart.setY (ev->y ()); - m_addpick = (m_keymods & Qt::ControlModifier); } @@ -967,8 +966,12 @@ // ============================================================================= void GLRenderer::wheelEvent (QWheelEvent* ev) { - m_zoom *= (ev->delta () < 0) ? 1.2f : (1.0f / 1.2f); - m_zoom = clamp (m_zoom, 0.01, 10000.0); + if (m_zoom > 15) + m_zoom *= (ev->delta () < 0) ? 1.2f : (1.0f / 1.2f); + else + m_zoom += (double) ev->delta () / -100.0f; + + m_zoom = clamp (m_zoom, 0.01f, 10000.0f); update (); ev->accept ();