Krita Source Code Documentation
Loading...
Searching...
No Matches
EllipseShapeConfigCommand.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 <klocalizedstring.h>
9#include "kis_command_ids.h"
10
12 : KUndo2Command(parent)
13 , m_ellipse(ellipse)
14 , m_newType(type)
15 , m_newStartAngle(startAngle)
16 , m_newEndAngle(endAngle)
17{
18 Q_ASSERT(m_ellipse);
19
20 setText(kundo2_i18n("Change ellipse"));
21
25}
26
45
64
70{
71 const EllipseShapeConfigCommand *other = dynamic_cast<const EllipseShapeConfigCommand*>(command);
72
73 if (!other || other->m_ellipse != m_ellipse) {
74 return false;
75 }
76
77 m_newType = other->m_newType;
80
81 return true;
82}
The undo / redo command for configuring an ellipse shape.
EllipseShape::EllipseType m_newType
void undo() override
revert the actions done in redo
void redo() override
redo the command
EllipseShape::EllipseType m_oldType
EllipseShapeConfigCommand(EllipseShape *ellipse, EllipseShape::EllipseType type, qreal startAngle, qreal startEndAngle, KUndo2Command *parent=0)
bool mergeWith(const KUndo2Command *command) override
void setType(EllipseType type)
qreal startAngle() const
Returns the actual ellipse start angle in degree.
void setStartAngle(qreal angle)
qreal endAngle() const
Returns the actual ellipse end angle in degree.
void setEndAngle(qreal angle)
EllipseType type() const
Returns the actual ellipse type.
EllipseType
the possible ellipse types
virtual void undo()
void setText(const KUndo2MagicString &text)
virtual void redo()
void update() const override
reimplemented
KUndo2MagicString kundo2_i18n(const char *text)