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++

Ensure that contour shapes get added when the whole text is converted to paths.

Wolthera van Hövell tot Westerflier8fb3cd1f290d
diff --git a/libs/flake/text/KoSvgTextShape.cpp b/libs/flake/text/KoSvgTextShape.cpp
index c16e065c00..d5cc956b87 100644
--- a/libs/flake/text/KoSvgTextShape.cpp
+++ b/libs/flake/text/KoSvgTextShape.cpp
@@ -2230,7 +2230,7 @@ void KoSvgTextShape::paintDebug(QPainter &painter, const DebugElements elements)
KoShape * KoSvgTextShape::textOutline() const
{
- KoShape *shape;
+ KoShape *shape = nullptr;
int currentIndex = 0;
if (!d->result.empty()) {
shape = d->collectPaths(this, d->result, currentIndex);
diff --git a/libs/flake/text/KoSvgTextShape_p_output.cpp b/libs/flake/text/KoSvgTextShape_p_output.cpp
index a844c846ac..e985f000d4 100644
--- a/libs/flake/text/KoSvgTextShape_p_output.cpp
+++ b/libs/flake/text/KoSvgTextShape_p_output.cpp
@@ -368,6 +368,19 @@ KoSvgTextShape::Private::collectPaths(const KoShape *rootShape, QVector<Characte
QList<KoShape *> shapes;
+ if (!internalShapes().isEmpty()) {
+ QList<KoShape *> internalS = internalShapes();
+ std::sort(internalS.begin(), internalS.end(), KoShape::compareShapeZIndex);
+ Q_FOREACH(KoShape *shape, internalS) {
+ KoShape *clone = shape->cloneShape();
+ clone->setZIndex(shapes.size());
+ if (clone->paintOrder() != rootShape->paintOrder()) {
+ clone->setInheritPaintOrder(false);
+ }
+ shapes.append(clone);
+ }
+ }
+
KoShapeFactoryBase *imageFactory = KoShapeRegistry::instance()->value("ImageShape");
const QString imageProp = "image";
const QString imageViewTransformProp = "viewboxTransform";