Mercurial > hg > svgui
comparison view/Pane.cpp @ 1505:1819978526f9
Debug changes
author | Chris Cannam |
---|---|
date | Fri, 13 Sep 2019 17:26:11 +0100 |
parents | 175770a13495 |
children | bfacecf7ea7e |
comparison
equal
deleted
inserted
replaced
1504:150d4e561b07 | 1505:1819978526f9 |
---|---|
1483 { | 1483 { |
1484 if (e && (e->buttons() & Qt::RightButton)) { | 1484 if (e && (e->buttons() & Qt::RightButton)) { |
1485 return; | 1485 return; |
1486 } | 1486 } |
1487 | 1487 |
1488 // cerr << "mouseReleaseEvent" << endl; | 1488 #ifdef DEBUG_PANE |
1489 SVCERR << "Pane[" << getId() << "]::mouseReleaseEvent" << endl; | |
1490 #endif | |
1489 | 1491 |
1490 ViewManager::ToolMode mode = ViewManager::NavigateMode; | 1492 ViewManager::ToolMode mode = ViewManager::NavigateMode; |
1491 if (m_manager) mode = m_manager->getToolModeFor(this); | 1493 if (m_manager) mode = m_manager->getToolModeFor(this); |
1492 | 1494 |
1493 m_releasing = true; | 1495 m_releasing = true; |
1978 true); // resist vert | 1980 true); // resist vert |
1979 | 1981 |
1980 if (m_dragMode == HorizontalDrag || | 1982 if (m_dragMode == HorizontalDrag || |
1981 m_dragMode == FreeDrag) { | 1983 m_dragMode == FreeDrag) { |
1982 | 1984 |
1983 sv_frame_t frameOff = getFrameForX(e->x()) - getFrameForX(m_clickPos.x()); | 1985 sv_frame_t fromFrame = getFrameForX(m_clickPos.x()); |
1986 sv_frame_t toFrame = getFrameForX(e->x()); | |
1987 sv_frame_t frameOff = toFrame - fromFrame; | |
1988 | |
1984 sv_frame_t newCentreFrame = m_dragCentreFrame; | 1989 sv_frame_t newCentreFrame = m_dragCentreFrame; |
1985 | |
1986 if (frameOff < 0) { | 1990 if (frameOff < 0) { |
1987 newCentreFrame -= frameOff; | 1991 newCentreFrame -= frameOff; |
1988 } else if (newCentreFrame >= frameOff) { | 1992 } else if (newCentreFrame >= frameOff) { |
1989 newCentreFrame -= frameOff; | 1993 newCentreFrame -= frameOff; |
1990 } else { | 1994 } else { |
1991 newCentreFrame = 0; | 1995 newCentreFrame = 0; |
1992 } | 1996 } |
1993 | 1997 |
1994 #ifdef DEBUG_PANE | 1998 #ifdef DEBUG_PANE |
1995 SVDEBUG << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame << | 1999 SVDEBUG << "Pane::dragTopLayer: dragged from x = " |
1996 ", models end frame = " << getModelsEndFrame() << endl; | 2000 << m_clickPos.x() << " to " << e->x() |
2001 << ", from frame = " << fromFrame | |
2002 << " to " << toFrame | |
2003 << ", for frame offset of " << frameOff << endl; | |
2004 SVDEBUG << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame | |
2005 << ", dragCentreFrame = " << m_dragCentreFrame | |
2006 << ", models end frame = " << getModelsEndFrame() << endl; | |
1997 #endif | 2007 #endif |
1998 | 2008 |
1999 if (newCentreFrame >= getModelsEndFrame()) { | 2009 if (newCentreFrame >= getModelsEndFrame()) { |
2000 newCentreFrame = getModelsEndFrame(); | 2010 newCentreFrame = getModelsEndFrame(); |
2001 if (newCentreFrame > 0) --newCentreFrame; | 2011 if (newCentreFrame > 0) --newCentreFrame; |