[vlmc-devel] commit: timeline: workaround for a viewport update bug. (Ludovic Fauvet )
git at videolan.org
git at videolan.org
Tue Mar 23 00:45:36 CET 2010
vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Tue Mar 23 00:17:21 2010 +0100| [e032aac6ee1800c884dc503aa14f6fcfb0be4f3d] | committer: Ludovic Fauvet
timeline: workaround for a viewport update bug.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=e032aac6ee1800c884dc503aa14f6fcfb0be4f3d
---
src/Gui/timeline/GraphicsCursorItem.cpp | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/Gui/timeline/GraphicsCursorItem.cpp b/src/Gui/timeline/GraphicsCursorItem.cpp
index a3e422d..47f5e38 100644
--- a/src/Gui/timeline/GraphicsCursorItem.cpp
+++ b/src/Gui/timeline/GraphicsCursorItem.cpp
@@ -21,6 +21,7 @@
*****************************************************************************/
#include <QtDebug>
+#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsSceneMouseEvent>
#include <QPainter>
@@ -57,6 +58,11 @@ QVariant GraphicsCursorItem::itemChange( GraphicsItemChange change, const QVaria
//Position is changing :
if ( change == QGraphicsItem::ItemPositionChange )
{
+ // When the cursor is moving fast, the viewport buffer
+ // is not correctly updated, forcing it now.
+ scene()->update( pos().x(), pos().y(), m_boundingRect.width(), m_boundingRect.height() );
+
+ // Keep the y axis in-place.
qreal posX = value.toPointF().x();
if ( posX < 0 ) posX = 0;
return QPoint( ( int ) posX, ( int ) pos().y() );
More information about the Vlmc-devel
mailing list