# HG changeset patch # User Chris Cannam # Date 1568391971 -3600 # Node ID 1819978526f94a766d47d10db8d66ccb2a0e9d66 # Parent 150d4e561b0782ff59b2c4c417801f0c4114724c Debug changes diff -r 150d4e561b07 -r 1819978526f9 view/Pane.cpp --- a/view/Pane.cpp Thu Sep 12 13:50:24 2019 +0100 +++ b/view/Pane.cpp Fri Sep 13 17:26:11 2019 +0100 @@ -1485,7 +1485,9 @@ return; } -// cerr << "mouseReleaseEvent" << endl; +#ifdef DEBUG_PANE + SVCERR << "Pane[" << getId() << "]::mouseReleaseEvent" << endl; +#endif ViewManager::ToolMode mode = ViewManager::NavigateMode; if (m_manager) mode = m_manager->getToolModeFor(this); @@ -1980,9 +1982,11 @@ if (m_dragMode == HorizontalDrag || m_dragMode == FreeDrag) { - sv_frame_t frameOff = getFrameForX(e->x()) - getFrameForX(m_clickPos.x()); + sv_frame_t fromFrame = getFrameForX(m_clickPos.x()); + sv_frame_t toFrame = getFrameForX(e->x()); + sv_frame_t frameOff = toFrame - fromFrame; + sv_frame_t newCentreFrame = m_dragCentreFrame; - if (frameOff < 0) { newCentreFrame -= frameOff; } else if (newCentreFrame >= frameOff) { @@ -1991,9 +1995,15 @@ newCentreFrame = 0; } -#ifdef DEBUG_PANE - SVDEBUG << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame << - ", models end frame = " << getModelsEndFrame() << endl; +#ifdef DEBUG_PANE + SVDEBUG << "Pane::dragTopLayer: dragged from x = " + << m_clickPos.x() << " to " << e->x() + << ", from frame = " << fromFrame + << " to " << toFrame + << ", for frame offset of " << frameOff << endl; + SVDEBUG << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame + << ", dragCentreFrame = " << m_dragCentreFrame + << ", models end frame = " << getModelsEndFrame() << endl; #endif if (newCentreFrame >= getModelsEndFrame()) {