The undo / redo command for joining two subpath end points.
Definition at line 18 of file KoSubpathJoinCommand.h.
Command to join two subpath end points.
The points have to be from the same path shape.
- Parameters
-
| pointData1 | the data of the first point to join |
| pointData2 | the data of the second point to join |
| parent | the parent command used for macro commands |
Definition at line 14 of file KoSubpathJoinCommand.cpp.
22{
31
32
35 }
36
44 } else {
46 }
47
50
53
56}
QPair< int, int > KoPathPointIndex
void setText(const KUndo2MagicString &text)
KUndo2Command(KUndo2Command *parent=0)
KoPathPointIndex pointIndex
position of the point in the path shape
KoPathShape * pathShape
path shape the path point belongs too
A KoPathPoint represents a point in a path.
PointProperties properties
@ Normal
it has no control points
The position of a path point within a path shape.
int subpathPointCount(int subpathIndex) const
Returns the number of points in a subpath.
bool isClosedSubpath(int subpathIndex) const
Checks if a subpath is closed.
KoPathPoint * pointByIndex(const KoPathPointIndex &pointIndex) const
Returns the path point specified by a path point index.
KoPathPoint::PointProperties m_oldProperties1
bool closeSubpathMode() const
KoPathPointIndex m_splitIndex
boost::optional< QPointF > m_savedControlPoint1
boost::optional< QPointF > m_savedControlPoint2
KoPathPointData m_pointData1
KoPathPointData m_pointData2
KoPathPoint::PointProperties m_oldProperties2
KUndo2MagicString kundo2_i18n(const char *text)
boost::optional< QPointF > fetchControlPoint(KoPathPoint *pt, bool takeFirst)
References closeSubpathMode(), KritaUtils::fetchControlPoint(), KoPathShape::isClosedSubpath(), KIS_ASSERT, kundo2_i18n(), m_oldProperties1, m_oldProperties2, m_pointData1, m_pointData2, m_reverse, m_savedControlPoint1, m_savedControlPoint2, KoPathPointData::pathShape, KoPathShape::pointByIndex(), KoPathPointData::pointIndex, KoPathPoint::properties, ReverseFirst, ReverseSecond, KUndo2Command::setText(), and KoPathShape::subpathPointCount().
| void KoSubpathJoinCommand::undo |
( |
| ) |
|
|
overridevirtual |
revert the actions done in redo
Reimplemented from KUndo2Command.
Definition at line 110 of file KoSubpathJoinCommand.cpp.
111{
115
118 } else {
121
124 }
127 }
128 }
131
134
135
139 } else {
142 }
143
146
151
154}
void setProperties(PointProperties properties)
Set the properties of a point.
bool breakAfter(const KoPathPointIndex &pointIndex)
Breaks the path after the point index.
KoPathPointIndex openSubpath(const KoPathPointIndex &pointIndex)
Opens a closed subpath.
void restoreControlPoint(KoPathPoint *pt, bool restoreFirst, boost::optional< QPointF > savedPoint)
References KoPathShape::breakAfter(), closeSubpathMode(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_oldProperties1, m_oldProperties2, m_pointData1, m_pointData2, m_reverse, m_savedControlPoint1, m_savedControlPoint2, m_splitIndex, KoPathShape::moveSubpath(), KoPathShape::normalize(), KoPathShape::openSubpath(), KoPathShape::pathPointIndex(), KoPathPointData::pathShape, KoPathShape::pointByIndex(), KoPathPointData::pointIndex, KoPathShape::recommendPointSelectionChange(), KritaUtils::restoreControlPoint(), ReverseFirst, ReverseSecond, KoPathShape::reverseSubpath(), KoPathPoint::setProperties(), KUndo2Command::undo(), and KoShapeContainer::update().