Krita Source Code Documentation
Loading...
Searching...
No Matches
SvgTextPathInfoChangeCommand.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
7#include "kis_command_ids.h"
9
11 : KUndo2Command(parent)
12 , m_shape(shape)
13 , m_textData(shape->getMemento())
14 , m_pos(pos)
15 , m_newInfo(textPathInfo)
16{
17 setText(kundo2_i18n("Change Text On Path Properties"));
18}
19
44
51
56
58{
59 const SvgTextPathInfoChangeCommand *command = dynamic_cast<const SvgTextPathInfoChangeCommand*>(other);
60
61 if (!command || command->m_shape != m_shape || m_pos != command->m_pos) {
62 return false;
63 }
64
65 m_newInfo = command->m_newInfo;
66 return true;
67
68}
void setText(const KUndo2MagicString &text)
static void bulkShapesUpdate(const UpdatesList &updates)
void notifyChanged()
Definition KoShape.cpp:618
The KoSvgTextNodeIndex class.
KoSvgTextProperties * properties()
properties The properties for this node as a pointer.
KoSvgText::TextOnPathInfo * textPathInfo()
textPathInfo the text path info for this node as a pointer.
@ TextAnchorId
KoSvgText::TextAnchor.
void setProperty(PropertyId id, const QVariant &value)
QVariant propertyOrDefault(PropertyId id) const
void notifyCursorPosChanged(int pos, int anchor)
Notify that the cursor position has changed.
KoSvgTextNodeIndex topLevelNodeForPos(int pos) const
topLevelNodeForPos Get, if possible, an index for the child element of the root at pos....
void setMemento(const KoSvgTextShapeMementoSP memento)
Set the text data and layout info, reset listening cursors to 0.
void relayout() const
SvgTextPathInfoChangeCommand(KoSvgTextShape *shape, int pos, KoSvgText::TextOnPathInfo textPathInfo, KUndo2Command *parent=nullptr)
bool mergeWith(const KUndo2Command *other) override
KUndo2MagicString kundo2_i18n(const char *text)
TextAnchor
Where the text is anchored for SVG 1.1 text and 'inline-size'.
Definition KoSvgText.h:79
@ AnchorEnd
Anchor right for LTR, left for RTL.
Definition KoSvgText.h:82
@ AnchorStart
Anchor left for LTR, right for RTL.
Definition KoSvgText.h:80
@ AnchorMiddle
Anchor to the middle.
Definition KoSvgText.h:81
TextPathMethod method
Definition KoSvgText.h:626
TextPathSpacing spacing
Definition KoSvgText.h:627