Krita Source Code Documentation
Loading...
Searching...
No Matches
KoParameterHandleMoveCommand.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2006 Jan Hambrecht <jaham@gmx.net>
3 * SPDX-FileCopyrightText: 2006, 2007 Thorsten Zachmann <zachmann@kde.org>
4 * SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8
10#include "KoParameterShape.h"
11#include <klocalizedstring.h>
12#include "kis_command_ids.h"
13
14KoParameterHandleMoveCommand::KoParameterHandleMoveCommand(KoParameterShape *shape, int handleId, const QPointF &startPoint, const QPointF &endPoint, Qt::KeyboardModifiers keyModifiers, KUndo2Command *parent)
15 : KUndo2Command(parent)
16 , m_shape(shape)
17 , m_handleId(handleId)
18 , m_startPoint(startPoint)
19 , m_endPoint(endPoint)
20 , m_keyModifiers(keyModifiers)
21{
22 setText(kundo2_i18n("Change parameter"));
23}
24
28
37
46
51
53{
54 const KoParameterHandleMoveCommand *other = dynamic_cast<const KoParameterHandleMoveCommand*>(command);
55
56 if (!other ||
57 other->m_shape != m_shape ||
58 other->m_handleId != m_handleId ||
60
61 return false;
62 }
63
64 m_endPoint = other->m_endPoint;
65
66 return true;
67}
68
virtual void undo()
void setText(const KUndo2MagicString &text)
virtual void redo()
The undo / redo command for changing a parameter.
bool mergeWith(const KUndo2Command *command) override
void redo() override
redo the command
KoParameterHandleMoveCommand(KoParameterShape *shape, int handleId, const QPointF &startPoint, const QPointF &endPoint, Qt::KeyboardModifiers keyModifiers, KUndo2Command *parent=0)
void undo() override
revert the actions done in redo
void moveHandle(int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
Move handle to point.
void update() const override
reimplemented
KUndo2MagicString kundo2_i18n(const char *text)