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 inline-wrap isn't applied when there's a flow shape.

Wolthera van Hövell tot Westerflier526284d1c4ab
diff --git a/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp b/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
index 817497daff..6e1e5d4514 100644
--- a/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
+++ b/plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
@@ -80,7 +80,7 @@ KUndo2Command *SvgCreateTextStrategy::createCommand()
const double lineHeight = m_minSizeInline.width();
const KoSvgText::WritingMode writingMode = KoSvgText::WritingMode(properties.propertyOrDefault(KoSvgTextProperties::WritingModeId).toInt());
- bool unwrappedText = m_modifiers.testFlag(Qt::ControlModifier);
+ bool unwrappedText = m_modifiers.testFlag(Qt::ControlModifier) || m_flowShape;
if (rectangle.width() < m_minSizeInline.width() && rectangle.height() < m_minSizeInline.height()) {
unwrappedText = true;
}
@@ -89,6 +89,9 @@ KUndo2Command *SvgCreateTextStrategy::createCommand()
val.isAuto = false;
val.customValue = writingMode == KoSvgText::HorizontalTB? rectangle.width(): rectangle.height();
properties.setProperty(KoSvgTextProperties::InlineSizeId, QVariant::fromValue(val));
+ } else {
+ // We explicitely remove the inline size, because it could've been inside the properties by a different method.
+ properties.removeProperty(KoSvgTextProperties::InlineSizeId);
}
if (writingMode != KoSvgText::HorizontalTB) {
properties.setProperty(KoSvgTextProperties::TextOrientationId, KoSvgText::OrientationUpright);