Commit c30616ba authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't start move-selection stroke if selection is empty

If selected are is empty, we shouldn't start any stroke, because
it'll be hightly confusing for the user.

We should also show a warning to the user, but we cannot add strings
to krita/4.3

BUG:407160
parent 923a9a71
......@@ -208,6 +208,9 @@ bool KisToolMove::startStrokeImpl(MoveToolMode mode, const QPoint *pos)
connect(moveStrategy,
SIGNAL(sigHandlesRectCalculated(const QRect&)),
SLOT(slotHandlesRectCalculated(const QRect&)));
connect(moveStrategy,
SIGNAL(sigStrokeStartedEmpty()),
SLOT(slotStrokeStartedEmpty()));
strategy = moveStrategy;
isMoveSelection = true;
......
......@@ -92,7 +92,12 @@ void MoveSelectionStrokeStrategy::initStrokeCallback()
KisLodTransform t(paintDevice);
handlesRect = t.mapInverted(handlesRect);
emit this->sigHandlesRectCalculated(handlesRect);
if (!handlesRect.isEmpty()) {
emit this->sigHandlesRectCalculated(handlesRect);
} else {
emit this->sigStrokeStartedEmpty();
}
}
}
......
......@@ -45,6 +45,7 @@ public:
Q_SIGNALS:
void sigHandlesRectCalculated(const QRect &handlesRect);
void sigStrokeStartedEmpty();
private:
MoveSelectionStrokeStrategy(const MoveSelectionStrokeStrategy &rhs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment