MonitorEditWidget *edit = monitor->getEffectEdit();
edit->showVisibilityButton(true);
m_scene = edit->getScene();
+ m_scene->cleanup();
m_item = new OnMonitorCornersItem();
m_scene->addItem(m_item);
connect(m_scene, SIGNAL(addKeyframe()), this, SLOT(slotInsertKeyframe()));
connect(keyframe_list, SIGNAL(cellChanged(int, int)), this, SLOT(slotUpdateItem()));
+ m_scene->centerView();
}
CornersWidget::~CornersWidget()
{
m_inPoint = minframe;
m_outPoint = maxframe;
+ m_scene->cleanup();
if (m_geometry)
m_geometry->parse(elem.attribute("value").toUtf8().data(), maxframe - minframe, m_monitor->render->frameRenderWidth(), m_monitor->render->renderHeight());
m_rect->setZValue(0);
m_scene->addItem(m_rect);
connect(m_rect, SIGNAL(changed()), this, SLOT(slotUpdateGeometry()));
-
+ m_scene->centerView();
slotPositionChanged(0, false);
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
}
connect(m_renderer, SIGNAL(frameUpdated(QImage)), this, SLOT(slotSetBackgroundImage(QImage)));
}
+void MonitorScene::centerView()
+{
+ if (m_view) m_view->centerOn(m_frameBorder);
+}
+
+void MonitorScene::cleanup()
+{
+ // Reset scene rect
+ setSceneRect(QRectF());
+}
+
void MonitorScene::setUp()
{
if (views().count() > 0) {
/** @brief Makes the background frame fit again after the profile changed (and therefore the resolution might have changed). */
void resetProfile();
+
+ /** @brief Reset scene size. */
+ void cleanup();
+
+ /** @brief Center view on frame border. */
+ void centerView();
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
MonitorEditWidget *edit = monitor->getEffectEdit();
edit->showVisibilityButton(true);
m_scene = edit->getScene();
+ m_scene->cleanup();
m_item = new SplineItem(QList <BPoint>(), NULL, m_scene);
setSpline(data, false);
setupTrackingListen(info);
+ m_scene->centerView();
}
RotoWidget::~RotoWidget()