Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_update_selection_job.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2013 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8#include "kis_image.h"
10
11
13 : m_selection(selection),
14 m_updateRect(updateRect)
15{
24 setExclusive(true);
25}
26
28{
29 const KisUpdateSelectionJob *otherJob =
30 dynamic_cast<const KisUpdateSelectionJob*>(_otherJob);
31
32 bool retval = false;
33
34 if (otherJob && otherJob->m_selection == m_selection) {
35 if (!m_updateRect.isEmpty()) {
36 m_updateRect |= otherJob->m_updateRect;
37 }
38 retval = true;
39 }
40
41 return retval;
42}
43
45{
46 QRect dirtyRect;
47
48 KisNodeSP parentNode = m_selection->parentNode();
49 if (parentNode) {
50 dirtyRect = parentNode->extent();
51 }
52
53 if (!m_updateRect.isEmpty()) {
55 } else {
57 }
58
60
67 if (parentNode && parentNode->projectionLeaf()->isOverlayProjectionLeaf()) {
68 dirtyRect |= parentNode->extent();
69 parentNode->setDirty(dirtyRect);
70 }
71}
72
74{
75 return 0;
76}
77
79{
80 return "KisUpdateSelectionJob";
81}
void setExclusive(bool value)
QString debugName() const override
bool overrides(const KisSpontaneousJob *otherJob) override
int levelOfDetail() const override
KisUpdateSelectionJob(KisSelectionSP selection, const QRect &updateRect=QRect())
virtual QRect extent() const
KisProjectionLeafSP projectionLeaf
Definition kis_node.cpp:93
virtual void setDirty()
Definition kis_node.cpp:577
void updateProjection(const QRect &rect)
void notifySelectionChanged()
KisNodeWSP parentNode