Krita Source Code Documentation
Loading...
Searching...
No Matches
RectangleShapeConfigCommand.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2007 Jan Hambrecht <jaham@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
8#include "RectangleShape.h"
9#include <klocalizedstring.h>
10#include "kis_command_ids.h"
11
12
13RectangleShapeConfigCommand::RectangleShapeConfigCommand(RectangleShape *rectangle, qreal cornerRadiusX, qreal cornerRadiusY, KUndo2Command *parent)
14 : KUndo2Command(parent)
15 , m_rectangle(rectangle)
16 , m_newCornerRadiusX(cornerRadiusX)
17 , m_newCornerRadiusY(cornerRadiusY)
18{
19 Q_ASSERT(m_rectangle);
20
21 setText(kundo2_i18n("Change rectangle"));
22
25}
26
42
58
63
65{
66 const RectangleShapeConfigCommand *other = dynamic_cast<const RectangleShapeConfigCommand*>(command);
67
68 if (!other || other->m_rectangle != m_rectangle) {
69 return false;
70 }
71
74
75 return true;
76}
virtual void undo()
void setText(const KUndo2MagicString &text)
virtual void redo()
void update() const override
reimplemented
The undo / redo command for configuring a rectangle shape.
RectangleShapeConfigCommand(RectangleShape *rectangle, qreal cornerRadiusX, qreal cornerRadiusY, KUndo2Command *parent=0)
void undo() override
revert the actions done in redo
bool mergeWith(const KUndo2Command *command) override
void redo() override
redo the command
qreal cornerRadiusX() const
Returns the corner radius in x-direction.
void setCornerRadiusY(qreal radius)
void setCornerRadiusX(qreal radius)
qreal cornerRadiusY() const
Returns the corner radius in y-direction.
KUndo2MagicString kundo2_i18n(const char *text)