[vlmc-devel] commit: TracksView: Allow a clip effect to be resized. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Sep 10 19:24:54 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Sep 10 17:20:01 2010 +0200| [60bec5e4f81448859e8070b399234b9cd4087bc7] | committer: Hugo Beauzée-Luyssen 

TracksView: Allow a clip effect to be resized.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=60bec5e4f81448859e8070b399234b9cd4087bc7
---

 src/Gui/timeline/GraphicsEffectItem.cpp |    8 +++++---
 src/Gui/timeline/TracksView.cpp         |   13 ++++++++-----
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/Gui/timeline/GraphicsEffectItem.cpp b/src/Gui/timeline/GraphicsEffectItem.cpp
index b398e27..a9e8ba8 100644
--- a/src/Gui/timeline/GraphicsEffectItem.cpp
+++ b/src/Gui/timeline/GraphicsEffectItem.cpp
@@ -77,7 +77,7 @@ GraphicsEffectItem::moveable() const
 bool
 GraphicsEffectItem::hasResizeBoundaries() const
 {
-    return false;
+    return ( m_effectHelper->end() != -1 );
 }
 
 Workflow::TrackType
@@ -212,13 +212,15 @@ GraphicsEffectItem::effectHelper()
 qint64
 GraphicsEffectItem::begin() const
 {
-    return 0;
+    return m_effectHelper->begin();
 }
 
 qint64
 GraphicsEffectItem::end() const
 {
-    return -1;
+    if ( m_effectHelper->end() < 0 )
+        return m_effectHelper->target()->length();
+    return m_effectHelper->end();
 }
 
 Workflow::Helper*
diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index 5f77e0b..d916285 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -901,13 +901,16 @@ TracksView::mouseMoveEvent( QMouseEvent *event )
         QList<QGraphicsItem*> gi = scene()->items( collidePos );
 
         bool collide = false;
-        for ( int i = 0; i < gi.count(); ++i )
+        if ( m_actionItem->type() != GraphicsEffectItem::Type )
         {
-            AbstractGraphicsMediaItem* mi = dynamic_cast<AbstractGraphicsMediaItem*>( gi.at( i ) );
-            if ( mi && mi != m_actionItem )
+            for ( int i = 0; i < gi.count(); ++i )
             {
-                collide = true;
-                break;
+                AbstractGraphicsMediaItem* mi = dynamic_cast<AbstractGraphicsMediaItem*>( gi.at( i ) );
+                if ( mi && mi != m_actionItem )
+                {
+                    collide = true;
+                    break;
+                }
             }
         }
         // END UGLY



More information about the Vlmc-devel mailing list