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

Fix the text tool creating texts without using the current foreground color.

Wolthera van Hövell tot Westerflier85ea954c4bfe
diff --git a/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp b/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
index 6460150bf0..4b72fc53ca 100644
--- a/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
+++ b/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
@@ -140,6 +140,14 @@ KUndo2Command *SvgCreateTextStrategy::createCommand()
KoSvgTextShape *textShape = dynamic_cast<KoSvgTextShape *>(factory->createShape( params, tool->canvas()->shapeController()->resourceManager()));
+ /// Properties don't write their fills/strokes to svg, so we need to set those manually.
+ if (properties.hasProperty(KoSvgTextProperties::FillId)) {
+ textShape->setBackground(properties.background());
+ }
+ if (properties.hasProperty(KoSvgTextProperties::StrokeId)) {
+ textShape->setStroke(properties.stroke());
+ }
+
KUndo2Command *parentCommand = new KUndo2Command();
new KoKeepShapesSelectedCommand(tool->koSelection()->selectedShapes(), {}, tool->canvas()->selectedShapesProxy(), false, parentCommand);