Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSvgTextFlipShapeContourTypeCommand.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-2.0-or-later
5
*/
6
#include "
KoSvgTextFlipShapeContourTypeCommand.h
"
7
8
#include <
KoSvgTextShape.h
>
9
#include <
KoShapeBulkActionLock.h
>
10
11
12
struct
KoSvgTextFlipShapeContourTypeCommand::Private
{
13
Private
(
KoSvgTextShape
*_text,
KoShape
*_shape)
14
:
textShape
(_text)
15
,
shape
(_shape)
16
,
isInside
(
textShape
->shapesInside().contains(_shape))
17
{
18
}
19
20
KoSvgTextShape
*
textShape
;
21
KoShape
*
shape
;
22
bool
isInside
=
false
;
23
};
24
25
KoSvgTextFlipShapeContourTypeCommand::KoSvgTextFlipShapeContourTypeCommand
(
KoSvgTextShape
*textShape,
KoShape
*shape,
KUndo2Command
*parent)
26
:
KUndo2Command
(parent)
27
, d(new
Private
(textShape, shape))
28
{
29
30
}
31
32
KoSvgTextFlipShapeContourTypeCommand::~KoSvgTextFlipShapeContourTypeCommand
()
33
{
34
35
}
36
37
void
KoSvgTextFlipShapeContourTypeCommand::redo
()
38
{
39
KoShapeBulkActionLock
lock(
d
->textShape);
40
41
d
->textShape->addShapeContours({
d
->shape}, !(
d
->isInside));
42
43
KoShapeBulkActionLock::bulkShapesUpdate
(lock.
unlock
());
44
}
45
46
void
KoSvgTextFlipShapeContourTypeCommand::undo
()
47
{
48
KoShapeBulkActionLock
lock(
d
->textShape);
49
50
d
->textShape->addShapeContours({
d
->shape},
d
->isInside);
51
52
KoShapeBulkActionLock::bulkShapesUpdate
(lock.
unlock
());
53
}
KoShapeBulkActionLock.h
KoSvgTextFlipShapeContourTypeCommand.h
KoSvgTextShape.h
KUndo2Command
Definition
kundo2stack.h:87
KoShapeBulkActionLock
Definition
KoShapeBulkActionLock.h:41
KoShapeBulkActionLock::bulkShapesUpdate
static void bulkShapesUpdate(const UpdatesList &updates)
Definition
KoShapeBulkActionLock.cpp:95
KoShapeBulkActionLock::unlock
UpdatesList unlock()
Definition
KoShapeBulkActionLock.h:58
KoShape
Definition
KoShape.h:89
KoSvgTextFlipShapeContourTypeCommand::KoSvgTextFlipShapeContourTypeCommand
KoSvgTextFlipShapeContourTypeCommand(KoSvgTextShape *textShape, KoShape *shape, KUndo2Command *parent=nullptr)
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:25
KoSvgTextFlipShapeContourTypeCommand::redo
void redo() override
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:37
KoSvgTextFlipShapeContourTypeCommand::undo
void undo() override
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:46
KoSvgTextFlipShapeContourTypeCommand::d
QScopedPointer< Private > d
Definition
KoSvgTextFlipShapeContourTypeCommand.h:25
KoSvgTextFlipShapeContourTypeCommand::~KoSvgTextFlipShapeContourTypeCommand
~KoSvgTextFlipShapeContourTypeCommand()
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:32
KoSvgTextShape
Definition
KoSvgTextShape.h:33
Private
Definition
SvgTransformParser.cpp:20
KoSvgTextFlipShapeContourTypeCommand::Private
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:12
KoSvgTextFlipShapeContourTypeCommand::Private::shape
KoShape * shape
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:21
KoSvgTextFlipShapeContourTypeCommand::Private::textShape
KoSvgTextShape * textShape
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:20
KoSvgTextFlipShapeContourTypeCommand::Private::isInside
bool isInside
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:22
KoSvgTextFlipShapeContourTypeCommand::Private::Private
Private(KoSvgTextShape *_text, KoShape *_shape)
Definition
KoSvgTextFlipShapeContourTypeCommand.cpp:13
libs
flake
commands
KoSvgTextFlipShapeContourTypeCommand.cpp
Generated at
2026-01-15 02:30:07+01:00
from
Krita
branch
master
, commit
38b517ca06286bb65279453cbf9a2b4fbd1153d1