[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita/kazakov/svg-loading] plugins/tools/defaulttool/defaulttool: Automatically enable Uniform Scal
From:       Dmitry Kazakov <null () kde ! org>
Date:       2016-12-30 10:02:46
Message-ID: E1cMu1O-00089h-9y () code ! kde ! org
[Download RAW message or body]

Git commit 45cb79a747824772690f630fc3f1dbe40ec7ac8e by Dmitry Kazakov.
Committed on 30/12/2016 at 10:02.
Pushed by dkazakov into branch 'kazakov/svg-loading'.

Automatically enable Uniform Scaling mode when a group shape is selected

M  +8    -2    plugins/tools/defaulttool/defaulttool/DefaultToolWidget.cpp

https://commits.kde.org/krita/45cb79a747824772690f630fc3f1dbe40ec7ac8e

diff --git a/plugins/tools/defaulttool/defaulttool/DefaultToolWidget.cpp \
b/plugins/tools/defaulttool/defaulttool/DefaultToolWidget.cpp index \
                cee5c36805a..d8eac25eeb4 100644
--- a/plugins/tools/defaulttool/defaulttool/DefaultToolWidget.cpp
+++ b/plugins/tools/defaulttool/defaulttool/DefaultToolWidget.cpp
@@ -34,8 +34,8 @@
 #include <commands/KoShapeSizeCommand.h>
 #include <commands/KoShapeTransformCommand.h>
 #include <commands/KoShapeKeepAspectRatioCommand.h>
-#include <KoPositionSelector.h>
 #include "SelectionDecorator.h"
+#include <KoShapeGroup.h>
 
 #include "KoAnchorSelectionWidget.h"
 
@@ -191,7 +191,13 @@ void DefaultToolWidget::slotUpdateCheckboxes()
     KoSelection *selection = m_tool->canvas()->shapeManager()->selection();
     QList<KoShape*> shapes = fetchEditableShapes(selection);
 
-    const bool uniformScalingAvailable = shapes.size() <= 1;
+    KoShapeGroup *onlyGroupShape = 0;
+
+    if (shapes.size() == 1) {
+        onlyGroupShape = dynamic_cast<KoShapeGroup*>(shapes.first());
+    }
+
+    const bool uniformScalingAvailable = shapes.size() <= 1 && !onlyGroupShape;
 
     if (uniformScalingAvailable && !chkUniformScaling->isEnabled()) {
         chkUniformScaling->setChecked(m_savedUniformScaling);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic