Mercurial > hg > svgui
diff view/View.cpp @ 516:e4e0ae491a48
* Attempt to pick more sensible default centre frame for newly created view
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2009 16:46:27 +0000 |
parents | 1341e95eeae9 |
children | 86559bf8219e |
line wrap: on
line diff
--- a/view/View.cpp Fri Feb 27 14:24:54 2009 +0000 +++ b/view/View.cpp Tue Mar 03 16:46:27 2009 +0000 @@ -676,16 +676,19 @@ connect(this, SIGNAL(zoomLevelChanged(unsigned long, bool)), m_manager, SLOT(viewZoomLevelChanged(unsigned long, bool))); +// setCentreFrame(m_manager->getViewInitialCentreFrame()); + if (m_followPlay == PlaybackScrollPage) { - std::cerr << "View::setViewManager: setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; +// std::cerr << "View::setViewManager: setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; setCentreFrame(m_manager->getGlobalCentreFrame(), false); } else if (m_followPlay == PlaybackScrollContinuous) { - std::cerr << "View::setViewManager: setting centre frame to playback frame: " << m_manager->getPlaybackFrame() << std::endl; +// std::cerr << "View::setViewManager: setting centre frame to playback frame: " << m_manager->getPlaybackFrame() << std::endl; setCentreFrame(m_manager->getPlaybackFrame(), false); } else if (m_followPan) { - std::cerr << "View::setViewManager: (follow pan) setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; +// std::cerr << "View::setViewManager: (follow pan) setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; setCentreFrame(m_manager->getGlobalCentreFrame(), false); } + if (m_followZoom) setZoomLevel(m_manager->getGlobalZoom()); movePlayPointer(getAlignedPlaybackFrame()); @@ -694,6 +697,13 @@ } void +View::setViewManager(ViewManager *vm, long initialCentreFrame) +{ + setViewManager(vm); + setCentreFrame(initialCentreFrame, false); +} + +void View::setFollowGlobalPan(bool f) { m_followPan = f;