Mercurial > hg > svgui
changeset 643:77fa3fdbfc7e sv_v2.1
Fix bug that caused overview to jump back to its original position after moving on double-click
author | Chris Cannam |
---|---|
date | Thu, 16 May 2013 13:11:13 +0100 |
parents | 2c35737cd3f8 |
children | 8ce18ec36fae 3437e0fad7ae |
files | view/Overview.cpp view/ViewManager.cpp |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/view/Overview.cpp Wed May 15 22:15:49 2013 +0100 +++ b/view/Overview.cpp Thu May 16 13:11:13 2013 +0100 @@ -22,7 +22,7 @@ #include <QPainter> #include <iostream> -#define DEBUG_OVERVIEW 1 +//#define DEBUG_OVERVIEW 1 using std::cerr; using std::endl; @@ -277,6 +277,9 @@ if (std::max(m_centreFrame, newCentreFrame) - std::min(m_centreFrame, newCentreFrame) > size_t(m_zoomLevel)) { size_t rf = alignToReference(newCentreFrame); +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::mouseMoveEvent: x " << e->x() << " and click x " << m_clickPos.x() << " -> frame " << newCentreFrame << " -> rf " << rf << std::endl; +#endif emit centreFrameChanged(rf, true, PlaybackScrollContinuous); } } @@ -287,6 +290,10 @@ long frame = getFrameForX(e->x()); size_t rf = 0; if (frame > 0) rf = alignToReference(frame); +#ifdef DEBUG_OVERVIEW + std::cerr << "Overview::mouseDoubleClickEvent: frame " << frame << " -> rf " << rf << std::endl; +#endif + m_clickedInRange = false; // we're not starting a drag with the second click emit centreFrameChanged(rf, true, PlaybackScrollContinuous); }