comparison view/View.cpp @ 236:90122740323f

* Fix alignment of new pane added after play position has changed (but global centre frame has not been explicitly moved)
author Chris Cannam
date Mon, 16 Apr 2007 15:16:10 +0000
parents efadb9d2b2c6
children 5105be027d8e
comparison
equal deleted inserted replaced
235:efadb9d2b2c6 236:90122740323f
554 disconnect(m_manager, SLOT(viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode))); 554 disconnect(m_manager, SLOT(viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode)));
555 disconnect(m_manager, SLOT(zoomLevelChanged(unsigned long, bool))); 555 disconnect(m_manager, SLOT(zoomLevelChanged(unsigned long, bool)));
556 } 556 }
557 557
558 m_manager = manager; 558 m_manager = manager;
559 if (m_followPlay != PlaybackIgnore) {
560 setCentreFrame(m_manager->getPlaybackFrame(), false);
561 } else if (m_followPan) {
562 setCentreFrame(m_manager->getGlobalCentreFrame(), false);
563 }
564 if (m_followZoom) setZoomLevel(m_manager->getGlobalZoom());
565 559
566 connect(m_manager, SIGNAL(globalCentreFrameChanged(unsigned long)), 560 connect(m_manager, SIGNAL(globalCentreFrameChanged(unsigned long)),
567 this, SLOT(globalCentreFrameChanged(unsigned long))); 561 this, SLOT(globalCentreFrameChanged(unsigned long)));
568 connect(m_manager, SIGNAL(viewCentreFrameChanged(View *, unsigned long)), 562 connect(m_manager, SIGNAL(viewCentreFrameChanged(View *, unsigned long)),
569 this, SLOT(viewCentreFrameChanged(View *, unsigned long))); 563 this, SLOT(viewCentreFrameChanged(View *, unsigned long)));
590 PlaybackFollowMode))); 584 PlaybackFollowMode)));
591 585
592 connect(this, SIGNAL(zoomLevelChanged(unsigned long, bool)), 586 connect(this, SIGNAL(zoomLevelChanged(unsigned long, bool)),
593 m_manager, SLOT(viewZoomLevelChanged(unsigned long, bool))); 587 m_manager, SLOT(viewZoomLevelChanged(unsigned long, bool)));
594 588
589 if (m_followPlay != PlaybackIgnore) {
590 // std::cerr << "View::setViewManager: setting centre frame to playback frame: " << m_manager->getPlaybackFrame() << std::endl;
591 setCentreFrame(m_manager->getPlaybackFrame(), false);
592 } else if (m_followPan) {
593 // std::cerr << "View::setViewManager: setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl;
594 setCentreFrame(m_manager->getGlobalCentreFrame(), false);
595 }
596 if (m_followZoom) setZoomLevel(m_manager->getGlobalZoom());
597
595 toolModeChanged(); 598 toolModeChanged();
596 } 599 }
597 600
598 void 601 void
599 View::setFollowGlobalPan(bool f) 602 View::setFollowGlobalPan(bool f)
1186 1189
1187 void 1190 void
1188 View::paintEvent(QPaintEvent *e) 1191 View::paintEvent(QPaintEvent *e)
1189 { 1192 {
1190 // Profiler prof("View::paintEvent", false); 1193 // Profiler prof("View::paintEvent", false);
1191 // std::cerr << "View::paintEvent" << std::endl; 1194 // std::cerr << "View::paintEvent: centre frame is " << m_centreFrame << std::endl;
1192 1195
1193 if (m_layers.empty()) { 1196 if (m_layers.empty()) {
1194 QFrame::paintEvent(e); 1197 QFrame::paintEvent(e);
1195 return; 1198 return;
1196 } 1199 }