Krita Source Code Documentation
Loading...
Searching...
No Matches
KisMoveBoundsCalculationJob.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8#include "kis_node.h"
9#include "kis_selection.h"
10#include "kis_layer_utils.h"
11
13 KisSelectionSP selection,
14 QObject *requestedBy)
15 : m_nodes(nodes),
16 m_selection(selection),
17 m_requestedBy(requestedBy)
18{
19 setExclusive(true);
20}
21
23{
24 QRect handlesRect;
25
26 Q_FOREACH (KisNodeSP node, m_nodes) {
28 }
29
30 if (m_selection) {
31 handlesRect &= m_selection->selectedExactRect();
32 }
33
34 Q_EMIT sigCalculationFinished(handlesRect);
35}
36
38{
39 const KisMoveBoundsCalculationJob *otherJob =
40 dynamic_cast<const KisMoveBoundsCalculationJob*>(_otherJob);
41
42 return otherJob && otherJob->m_requestedBy == m_requestedBy;
43}
44
46{
47 return 0;
48}
49
51{
52 QString result;
53 QDebug dbg(&result);
54 dbg << "KisMoveBoundsCalculationJob" << ppVar(m_requestedBy) << m_nodes;
55 return result;
56}
KisMoveBoundsCalculationJob(KisNodeList nodes, KisSelectionSP selection, QObject *requestedBy)
void sigCalculationFinished(const QRect &bounds)
bool overrides(const KisSpontaneousJob *otherJob) override
void setExclusive(bool value)
#define ppVar(var)
Definition kis_debug.h:155
QRect recursiveTightNodeVisibleBounds(KisNodeSP rootNode)
QRect selectedExactRect() const
Slow, but exact way of determining the rectangle that encloses the selection.