-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

till now when you click to add text in the title widget the point
clicked is the top left edge of the font.

After applying the patch:
When you click to add text it will be positioned centered in front of
the cursor.

This will probably fix: http://www.kdenlive.org/mantis/view.php?id=925

ttill
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAks/waEACgkQzwEyz7QP6nSTcACgs3iD9O7NkurP0EdLjvt5sT8J
0cIAoL9gYrlydh91SzPp+OcSr65Eu4Fg
=M3Cm
-----END PGP SIGNATURE-----
Index: src/graphicsscenerectmove.cpp
===================================================================
--- src/graphicsscenerectmove.cpp	(revision 4192)
+++ src/graphicsscenerectmove.cpp	(working copy)
@@ -42,6 +42,7 @@
     //grabMouse();
     m_zoom = 1.0;
     setBackgroundBrush(QBrush(Qt::transparent));
+    m_fontSize = 0;
 }
 
 void GraphicsSceneRectMove::setSelectedItem(QGraphicsItem *item)
@@ -248,7 +249,7 @@
         emit newText((QGraphicsTextItem *) m_selectedItem);
         m_selectedItem->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
         ((QGraphicsTextItem *)m_selectedItem)->setTextInteractionFlags(Qt::TextEditorInteraction);
-        m_selectedItem->setPos(e->scenePos());
+        m_selectedItem->setPos(e->scenePos() - QPointF(0, (int)(m_fontSize/2)));
         QGraphicsScene::mousePressEvent(e);
     }
 
@@ -562,3 +563,10 @@
     else if (angle > 112.5 && angle <= 157.5)
         setCursor(Qt::SizeBDiagCursor);
 }
+
+void GraphicsSceneRectMove::slotUpdateFontSize(int s)
+{
+	m_fontSize = s;
+}
+
+#include "graphicsscenerectmove.moc"
Index: src/titlewidget.cpp
===================================================================
--- src/titlewidget.cpp	(revision 4192)
+++ src/titlewidget.cpp	(working copy)
@@ -295,6 +295,7 @@
     graphicsView->setScene(m_scene);
     m_titledocument.setScene(m_scene, m_frameWidth, m_frameHeight);
     connect(m_scene, SIGNAL(changed(QList<QRectF>)), this, SLOT(slotChanged()));
+    connect(font_size, SIGNAL(valueChanged(int)), m_scene, SLOT(slotUpdateFontSize(int)));
 
     // a gradient background
     /*QRadialGradient *gradient = new QRadialGradient(0, 0, 10);
Index: src/graphicsscenerectmove.h
===================================================================
--- src/graphicsscenerectmove.h	(revision 4192)
+++ src/graphicsscenerectmove.h	(working copy)
@@ -39,6 +39,9 @@
     TITLETOOL tool();
     void clearTextSelection();
 
+public slots:
+	void slotUpdateFontSize(int s);
+
 protected:
     virtual void keyPressEvent(QKeyEvent * keyEvent);
     virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
@@ -56,6 +59,7 @@
     QPointF m_sceneClickPoint;
     TITLETOOL m_tool;
     QPoint m_clickPoint;
+    int m_fontSize;
 
 signals:
     void itemMoved();
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Kdenlive-devel mailing list
Kdenlive-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kdenlive-devel

Reply via email to