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 setting fill and stroke on text.

Wolthera van Hövell tot Westerflierf2ae140dcded
diff --git a/plugins/tools/svgtexttool/SvgTextCursor.cpp b/plugins/tools/svgtexttool/SvgTextCursor.cpp
index 8106a71def..8f26dc3b9b 100644
--- a/plugins/tools/svgtexttool/SvgTextCursor.cpp
+++ b/plugins/tools/svgtexttool/SvgTextCursor.cpp
@@ -864,7 +864,7 @@ void SvgTextCursor::canvasResourceChanged(int key, const QVariant &value)
return;
KoSvgTextProperties props;
- KoSvgTextProperties shapeProps = d->shape->propertiesForPos(d->pos, true);
+ KoSvgTextProperties shapeProps = hasSelection()? d->shape->propertiesForPos(d->pos, true): d->shape->textProperties();
if (key == KoCanvasResource::ForegroundColor) {
QSharedPointer<KoShapeBackground> bg(new KoColorBackground(value.value<KoColor>().toQColor()));
if (bg != shapeProps.background()) {
@@ -1422,7 +1422,7 @@ void SvgTextCursor::updateCanvasResources()
// Only update canvas resources when there's no selection.
// This relies on Krita not setting anything on the text when there's no selection.
if (d->shape && d->canvas->resourceManager() && d->pos == d->anchor) {
- KoSvgTextProperties props = d->shape->propertiesForPos(d->pos, true);
+ KoSvgTextProperties props = hasSelection()? d->shape->propertiesForPos(d->pos, true): d->shape->textProperties();
KoColorBackground *bg = dynamic_cast<KoColorBackground *>(props.background().data());
if (bg) {
KoColor c;