Commit b62b8949 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Fix effect resizing undo/redo

parent 64530b35
......@@ -22,6 +22,7 @@
#include "AbstractGraphicsItem.h"
#include "Helper.h"
#include "GraphicsTrack.h"
#include "TracksView.h"
#include "TracksScene.h"
......@@ -263,3 +264,10 @@ AbstractGraphicsItem::width() const
{
return m_width;
}
void
AbstractGraphicsItem::adjustLength()
{
setWidth( helper()->length() );
}
......@@ -179,6 +179,11 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
* \return Returns True if the point is in a resize zone.
*/
bool resizeZone( const QPointF& position );
/**
* \brief Adjust the length of the item according to the associated Clip.
* \details This method should be called when the clip size change
*/
void adjustLength();
friend class TracksView;
......
......@@ -216,14 +216,6 @@ AbstractGraphicsMediaItem::maxEnd() const
return clipHelper()->clip()->end();
}
void
AbstractGraphicsMediaItem::adjustLength()
{
Q_ASSERT( m_clipHelper );
setWidth( m_clipHelper->length() );
}
void
AbstractGraphicsMediaItem::hoverEnterEvent( QGraphicsSceneHoverEvent* event )
{
......
......@@ -76,12 +76,6 @@ protected:
ClipHelper* m_clipHelper;
private slots:
/**
* \brief Adjust the length of the item according to the associated Clip.
* \details This method should be called when the clip size change
*/
void adjustLength();
void clipDestroyed( Clip* clip );
private:
......
......@@ -40,6 +40,7 @@ GraphicsEffectItem::GraphicsEffectItem( Effect *effect ) :
{
setOpacity( 0.8 );
m_effectHelper = new EffectHelper( effect->createInstance() );
connect( m_effectHelper, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
setWidth( m_effectHelper->length() );
}
......@@ -48,6 +49,7 @@ GraphicsEffectItem::GraphicsEffectItem( EffectHelper *helper ) :
{
setWidth( m_effectHelper->length() );
m_effect = helper->effectInstance()->effect();
connect( helper, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
setOpacity( 0.8 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment