Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Skip text paths when setting text transforms.

Wolthera van Hövell tot Westerfliere261380103ec
diff --git a/libs/flake/text/KoSvgTextShape.cpp b/libs/flake/text/KoSvgTextShape.cpp
index e8a9e618d3..ae3d6817b0 100644
--- a/libs/flake/text/KoSvgTextShape.cpp
+++ b/libs/flake/text/KoSvgTextShape.cpp
@@ -1272,9 +1272,8 @@ bool KoSvgTextShape::setCharacterTransformsOnRange(const int startPos, const int
int currentIndex = 0;
QPointF accumulatedOffset;
for (auto it = d->textData.depthFirstTailBegin(); it != d->textData.depthFirstTailEnd(); it++) {
- if (KoSvgTextShape::Private::childCount(siblingCurrent(it)) > 0) {
+ if (KoSvgTextShape::Private::childCount(siblingCurrent(it)) > 0 || !it->textPathId.isEmpty()) {
continue;
- // TODO: also skip textpaths, their transforms aren't read.
}
int endContentElement = it->finalResultIndex;
diff --git a/plugins/tools/svgtexttool/SvgTextCursor.cpp b/plugins/tools/svgtexttool/SvgTextCursor.cpp
index 7f76e0bc01..084853d467 100644
--- a/plugins/tools/svgtexttool/SvgTextCursor.cpp
+++ b/plugins/tools/svgtexttool/SvgTextCursor.cpp
@@ -424,8 +424,9 @@ void SvgTextCursor::setDrawTypeSettingHandle(bool draw)
void SvgTextCursor::updateTypeSettingDecorFromShape()
{
if (d->shape) {
- d->typeSettingDecor.handlesEnabled = (d->shape->textType() == KoSvgTextShape::PreformattedText
- || d->shape->textType() == KoSvgTextShape::PrePositionedText);
+ d->typeSettingDecor.handlesEnabled = ((d->shape->textType() == KoSvgTextShape::PreformattedText
+ || d->shape->textType() == KoSvgTextShape::PrePositionedText)
+ && !(d->shape->topLevelNodeForPos(d->pos).textPath()));
}
}
@@ -1817,6 +1818,7 @@ void SvgTextCursor::updateTypeSettingDecoration()
updateRect = d->shape->shapeToDocument(d->typeSettingDecor.boundingRect(d->handleRadius));
}
+ updateTypeSettingDecorFromShape(); // To remove the text-in-path nodes..
Q_EMIT updateCursorDecoration(updateRect | d->oldTypeSettingRect);
d->oldTypeSettingRect = updateRect;
}