Mercurial > hg > svgui
comparison view/Pane.cpp @ 1449:ce5f80a7c697 single-point
Don't discard large wheel deltas; just clamp them
author | Chris Cannam |
---|---|
date | Wed, 01 May 2019 14:40:51 +0100 |
parents | c8a6fd3f9dff |
children | f9110e5afca1 |
comparison
equal
deleted
inserted
replaced
1448:4b7fc925a5ce | 1449:ce5f80a7c697 |
---|---|
2296 } else { | 2296 } else { |
2297 | 2297 |
2298 // Coarse wheel information (or vertical zoom, which is | 2298 // Coarse wheel information (or vertical zoom, which is |
2299 // necessarily coarse itself) | 2299 // necessarily coarse itself) |
2300 | 2300 |
2301 // Sometimes on Linux we're seeing absurdly extreme angles on | 2301 // Sometimes on Linux we're seeing very extreme angles on the |
2302 // the first wheel event -- discard those entirely | 2302 // first wheel event. They could be spurious, or they could be |
2303 if (abs(m_pendingWheelAngle) >= 600) { | 2303 // a result of the user frantically wheeling away while the |
2304 m_pendingWheelAngle = 0; | 2304 // pane was unresponsive for some reason. We don't want to |
2305 return; | 2305 // discard them, as that makes the application feel even less |
2306 // responsive, but if we take them literally we risk changing | |
2307 // the view so radically that the user won't recognise what | |
2308 // has happened. Clamp them instead. | |
2309 if (m_pendingWheelAngle > 600) { | |
2310 m_pendingWheelAngle = 600; | |
2311 } | |
2312 if (m_pendingWheelAngle < -600) { | |
2313 m_pendingWheelAngle = -600; | |
2306 } | 2314 } |
2307 | 2315 |
2308 while (abs(m_pendingWheelAngle) >= 120) { | 2316 while (abs(m_pendingWheelAngle) >= 120) { |
2309 | 2317 |
2310 int sign = (m_pendingWheelAngle < 0 ? -1 : 1); | 2318 int sign = (m_pendingWheelAngle < 0 ? -1 : 1); |