Mercurial > hg > svcore
diff base/View.cpp @ 12:f67ddc287bc3
* Add ability to create empty layers for editing
* Add first basic editing capability (adding points to a time instant layer)
* Add various keyboard and mouse shortcuts for navigation &c
* Add ability to resize a selection by dragging its edges
* Add maximum zoom level
author | Chris Cannam |
---|---|
date | Thu, 26 Jan 2006 16:15:40 +0000 |
parents | ec6886f0e673 |
children | 47500c27ac26 |
line wrap: on
line diff
--- a/base/View.cpp Thu Jan 26 11:56:09 2006 +0000 +++ b/base/View.cpp Thu Jan 26 16:15:40 2006 +0000 @@ -755,6 +755,26 @@ } void +View::scroll(bool right, bool lots) +{ + long delta; + if (lots) { + delta = ((width() / 2) * m_zoomLevel); + } else { + delta = ((width() / 20) * m_zoomLevel); + } + if (right) delta = -delta; + + if (int(m_centreFrame) < delta) { + setCentreFrame(0); + } else if (int(m_centreFrame) - delta >= int(getModelsEndFrame())) { + setCentreFrame(getModelsEndFrame()); + } else { + setCentreFrame(m_centreFrame - delta); + } +} + +void View::checkProgress(void *object) { // std::cerr << "View::checkProgress(" << object << ")" << std::endl;