Commit 61d75636 authored by Thorsten Zachmann's avatar Thorsten Zachmann

o Fix undo/redo of parameter shapes when the shape changed it size e.g.

  in the ellipse. The point to where the handle is moved has to be given
  in document coordinates as shape coordinates can change.

svn path=/trunk/koffice/; revision=616427
parent a57c8a9c
......@@ -25,7 +25,7 @@ KoParameterChangeStrategy::KoParameterChangeStrategy( KoTool *tool, KoCanvasBase
: KoInteractionStrategy( tool, canvas )
, m_parameterShape( parameterShape )
, m_handleId( handleId )
, m_startPoint( m_parameterShape->handlePosition( handleId ) )
, m_startPoint( m_parameterShape->shapeToDocument( m_parameterShape->handlePosition( handleId ) ) )
{
}
......@@ -35,7 +35,7 @@ KoParameterChangeStrategy::~KoParameterChangeStrategy()
void KoParameterChangeStrategy::handleMouseMove( const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers )
{
m_parameterShape->moveHandle( m_handleId, m_parameterShape->documentToShape( mouseLocation ), modifiers );
m_parameterShape->moveHandle( m_handleId, mouseLocation, modifiers );
}
QUndoCommand* KoParameterChangeStrategy::createCommand()
......@@ -44,7 +44,7 @@ QUndoCommand* KoParameterChangeStrategy::createCommand()
// check if handle position changed
if ( m_startPoint != m_parameterShape->handlePosition( m_handleId ) )
{
cmd = new KoParameterChangeCommand( m_parameterShape, m_handleId, m_startPoint, m_parameterShape->handlePosition( m_handleId ) );
cmd = new KoParameterChangeCommand( m_parameterShape, m_handleId, m_startPoint, m_parameterShape->shapeToDocument( m_parameterShape->handlePosition( m_handleId ) ) );
}
return cmd;
}
......
......@@ -41,7 +41,7 @@ void KoParameterShape::moveHandle( int handleId, const QPointF & point, Qt::Keyb
repaint();
// function to do special stuff
moveHandleAction( handleId, point, modifiers );
moveHandleAction( handleId, documentToShape( point ), modifiers );
updatePath( size() );
repaint();
......
......@@ -36,7 +36,7 @@ public:
* After that updatePath and a repaint is called.
*
* @param handleId of the handle
* @param point to move the handle to
* @param point to move the handle to in document coordinates
* @param modifiers used during move to point
*/
virtual void moveHandle( int handleId, const QPointF & point, Qt::KeyboardModifiers modifiers = Qt::NoModifier );
......@@ -103,7 +103,7 @@ protected:
* This method is called from moveHandle.
*
* @param handleId of the handle
* @param point to move the handle to
* @param point to move the handle to in shape coordinates
* @param modifiers used during move to point
*/
virtual void moveHandleAction( int handleId, const QPointF & point, Qt::KeyboardModifiers modifiers = Qt::NoModifier ) = 0;
......
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