From: Martin S. <mc...@as...> - 2006-09-25 02:44:02
|
What my previous patch didn't address, was another problem that I previously noted, wherein if one didn't manage to drag the cursor quickly enough to the edge of the matrix view, smooth scrolling didn't start. The following patch, which includes the previous patch, fixes this as well. Basically, there was a clause in doAutoScroll() (in rosegardencanvasview.cpp), that turned off autoscrolling if no autoscrolling motions were performed within 20 move events. Since no autoscrolling occurs until the cursor nears the edges of the display area, autoscrolling thus got cancelled if one started with the cursor near the middle of the display area, and then dragged at a reasonable speed towards an edge. I suspect that the above clause was designed to stop the effect whereby after pausing a drag, when one has already reached a high speed, the scrolling restarts at that high speed, when the user starts moving the mouse again. A better way to deal with this, IMHO, is to simply knock the auto-scroll speed back down to its default start value, whenever the user pauses dragging, and this is what the patch below does. Note that this also fixes the same problem that occured with dragging out the selection, in the matrix view. While this patch appears to fix all of the auto-scrolling issues of the matrix view, I haven't worked out equivalent fixes for the notation view, since auto-scrolling/paged-scrolling seem to be triggered a bit differently there, and I haven't had time to figure out how this works. Index: gui/matrixview.h =================================================================== --- gui/matrixview.h (revision 7549) +++ gui/matrixview.h (working copy) @@ -360,6 +360,10 @@ slotSetInsertCursorPosition(position, true); } + virtual void slotSetInsertCursorPositionUnscrolled(Rosegarden::timeT position) { + slotSetInsertCursorPosition(position, false); + } + /** * Catch the keyboard being pressed */ Index: gui/rosegardencanvasview.cpp =================================================================== --- gui/rosegardencanvasview.cpp (revision 7549) +++ gui/rosegardencanvasview.cpp (working copy) @@ -138,8 +138,6 @@ QPoint dp = p - previousP; previousP = p; - static int quiet = 0; - m_autoScrollTimer.start( m_autoScrollTime ); ScrollDirection scrollDirection = None; @@ -190,15 +188,9 @@ // is presumably still pressed. m_minDeltaScroll = DefaultMinDeltaScroll; m_currentScrollDirection = None; + } else { + m_minDeltaScroll = DefaultMinDeltaScroll; } - - if (dx || dy) quiet = 0; - else ++quiet; - - if (quiet == 20) { - stopAutoScroll(); - quiet = 0; - } } Index: gui/matrixview.cpp =================================================================== --- gui/matrixview.cpp (revision 7549) +++ gui/matrixview.cpp (working copy) @@ -415,12 +415,12 @@ QObject::connect (topBarButtons->getLoopRuler(), SIGNAL(setPointerPosition(Rosegarden::timeT)), - this, SLOT(slotSetInsertCursorPosition(Rosegarden::timeT))); + this, SLOT(slotSetInsertCursorPositionUnscrolled(Rosegarden::timeT))); QObject::connect (topBarButtons, SIGNAL(dragPointerToPosition(Rosegarden::timeT)), - this, SLOT(slotSetInsertCursorPosition(Rosegarden::timeT))); + this, SLOT(slotSetInsertCursorPositionUnscrolled(Rosegarden::timeT))); topBarButtons->getLoopRuler()->setBackgroundColor (Rosegarden::GUIPalette::getColour(Rosegarden::GUIPalette::InsertCursorRuler)); |