]> git.sesse.net Git - kdenlive/commitdiff
Fix title clips that have items outside frame rect
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 31 Jul 2009 11:23:07 +0000 (11:23 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 31 Jul 2009 11:23:07 +0000 (11:23 +0000)
svn path=/trunk/kdenlive/; revision=3792

src/mainwindow.cpp
src/titledocument.cpp
src/titledocument.h
src/titlewidget.cpp

index 8d4fab3f2b9afef9918babc73c828886ccfea243..01070e7c29b7efb9df9e475d12f9410c6077b456 100644 (file)
@@ -1621,7 +1621,7 @@ void MainWindow::slotEditProjectSettings()
             // Deselect current effect / transition
             m_effectStack->slotClipItemSelected(NULL, 0);
             m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false);
-
+            m_clipMonitor->slotSetXml(NULL, 0);
             m_activeDocument->setProfilePath(profile);
             KdenliveSettings::setCurrent_profile(profile);
             KdenliveSettings::setProject_fps(m_activeDocument->fps());
index beba85217cde60044a641744bd6d99645b3be4d6..99ca180a8d06ade43ccc5ad2066dcefa826554cb 100644 (file)
@@ -40,9 +40,11 @@ TitleDocument::TitleDocument()
     m_scene = NULL;
 }
 
-void TitleDocument::setScene(QGraphicsScene* _scene)
+void TitleDocument::setScene(QGraphicsScene* _scene, int width, int height)
 {
     m_scene = _scene;
+    m_width = width;
+    m_height = height;
 }
 
 QDomDocument TitleDocument::xml(QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv)
@@ -50,8 +52,8 @@ QDomDocument TitleDocument::xml(QGraphicsPolygonItem* startv, QGraphicsPolygonIt
     QDomDocument doc;
 
     QDomElement main = doc.createElement("kdenlivetitle");
-    main.setAttribute("width", m_scene->width());
-    main.setAttribute("height", m_scene->height());
+    main.setAttribute("width", m_width);
+    main.setAttribute("height", m_height);
     doc.appendChild(main);
 
     foreach(QGraphicsItem* item, m_scene->items()) {
index 637cdfa28ce5c7f4cc1219dadbc2d6806d666ddf..cc669f7056b2008d7b5e13539249edb0202f1cd7 100644 (file)
@@ -29,7 +29,7 @@ class TitleDocument
 
 public:
     TitleDocument();
-    void setScene(QGraphicsScene* scene);
+    void setScene(QGraphicsScene* scene, int width, int height);
     bool saveDocument(const KUrl& url, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv, double out);
     int loadDocument(const KUrl& url, QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv, double *out);
     QDomDocument xml(QGraphicsPolygonItem* startv, QGraphicsPolygonItem* endv);
@@ -43,6 +43,8 @@ public:
 
 private:
     QGraphicsScene* m_scene;
+    int m_width;
+    int m_height;
     QString colorToString(const QColor&);
     QString rectFToString(const QRectF&);
     QRectF stringToRect(const QString &);
index b42dd332d56e006275387f237c4a8a79b57f4a4f..938ff35a7903f0cfff71b912836b58efcf5f31ec 100644 (file)
@@ -221,7 +221,7 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
     // initialize graphic scene
     m_scene = new GraphicsSceneRectMove(this);
     graphicsView->setScene(m_scene);
-    m_titledocument.setScene(m_scene);
+    m_titledocument.setScene(m_scene, m_frameWidth, m_frameHeight);
     connect(m_scene, SIGNAL(changed(QList<QRectF>)), this, SLOT(slotChanged()));
 
     // a gradient background