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

Type setting mode: don't maintain pos when there's no selection.

Wolthera van Hövell tot Westerfliere2fb7c0c4957
diff --git a/plugins/tools/svgtexttool/SvgTextTypeSettingStrategy.cpp b/plugins/tools/svgtexttool/SvgTextTypeSettingStrategy.cpp
index b7575dc60d..f43b1fb70c 100644
--- a/plugins/tools/svgtexttool/SvgTextTypeSettingStrategy.cpp
+++ b/plugins/tools/svgtexttool/SvgTextTypeSettingStrategy.cpp
@@ -106,8 +106,8 @@ KUndo2Command *SvgTextTypeSettingStrategy::createCommand()
length.value *= scale;
props.setFontSize(length);
- if (m_shape->textType() == KoSvgTextShape::PreformattedText || m_shape->textType() == KoSvgTextShape::PrePositionedText) {
- // When we change font size, we need to correct the offset for the scaled advances.
+ if ((m_shape->textType() == KoSvgTextShape::PreformattedText || m_shape->textType() == KoSvgTextShape::PrePositionedText) && m_cursorPos != m_cursorAnchor) {
+ // When we change font size on a selection, we need to correct the offset for the scaled advances.
// Technically, we need to test against the laid out text to get the correct advance, but that's really complicated...
QPointF diff = QPointF();