[vlmc-devel] commit: GraphicsEffectItem: Fixing resize boundaries ( 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 18:09:25 2010 +0200| [c759d32dc5f1fb0afab388d59fc67bc14447116b] | committer: Hugo Beauzée-Luyssen 

GraphicsEffectItem: Fixing resize boundaries

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

 src/Gui/timeline/AbstractGraphicsItem.h |    4 ++--
 src/Gui/timeline/GraphicsEffectItem.cpp |   12 ++++++++++++
 src/Gui/timeline/GraphicsEffectItem.h   |    2 ++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/Gui/timeline/AbstractGraphicsItem.h b/src/Gui/timeline/AbstractGraphicsItem.h
index f177f9c..6302f22 100644
--- a/src/Gui/timeline/AbstractGraphicsItem.h
+++ b/src/Gui/timeline/AbstractGraphicsItem.h
@@ -153,11 +153,11 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
         /**
          *  \brief          Return the begin boundaries for the item.
          */
-        virtual qint64      maxBegin() const { return 0; }
+        virtual qint64      maxBegin() const = 0;
         /**
          *  \brief          Return the end boundaries for the item.
          */
-        virtual qint64      maxEnd() const { return -1; }
+        virtual qint64      maxEnd() const = 0;
 
     protected:
         static const quint32    RounderRectRadius = 5;
diff --git a/src/Gui/timeline/GraphicsEffectItem.cpp b/src/Gui/timeline/GraphicsEffectItem.cpp
index 214bd31..2116872 100644
--- a/src/Gui/timeline/GraphicsEffectItem.cpp
+++ b/src/Gui/timeline/GraphicsEffectItem.cpp
@@ -226,6 +226,18 @@ GraphicsEffectItem::end() const
     return m_effectHelper->end();
 }
 
+qint64
+GraphicsEffectItem::maxBegin() const
+{
+    return 0;
+}
+
+qint64
+GraphicsEffectItem::maxEnd() const
+{
+    return m_effectHelper->target()->length();
+}
+
 Workflow::Helper*
 GraphicsEffectItem::helper()
 {
diff --git a/src/Gui/timeline/GraphicsEffectItem.h b/src/Gui/timeline/GraphicsEffectItem.h
index f0ee2c1..afee7fb 100644
--- a/src/Gui/timeline/GraphicsEffectItem.h
+++ b/src/Gui/timeline/GraphicsEffectItem.h
@@ -45,6 +45,8 @@ class GraphicsEffectItem : public AbstractGraphicsItem
         EffectHelper*               effectHelper();
         virtual qint64              begin() const;
         virtual qint64              end() const;
+        virtual qint64              maxBegin() const;
+        virtual qint64              maxEnd() const;
         virtual Workflow::Helper    *helper();
         virtual void                triggerMove(TrackWorkflow *oldTrack, TrackWorkflow *newTrack,
                                                 Workflow::Helper *helper, qint64 pos);



More information about the Vlmc-devel mailing list