~ubuntu-branches/ubuntu/raring/koffice/raring

« back to all changes in this revision

Viewing changes to krita/image/kis_full_refresh_walker.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-12-06 15:30:09 UTC
  • mfrom: (0.13.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101206153009-yf0dqbp9l7fzwxi8
Tags: 1:2.2.91-0ubuntu1
New upstream RC release

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include "kis_node.h"
23
23
#include "kis_types.h"
 
24
#include "kis_clone_layer.h"
24
25
#include "kis_base_rects_walker.h"
25
26
 
 
27
 
26
28
class KRITAIMAGE_EXPORT KisFullRefreshWalker : public KisBaseRectsWalker
27
29
{
28
30
 
116
118
                startTrip(currentNode);
117
119
        } while ((currentNode = currentNode->prevSibling()));
118
120
    }
 
121
 
 
122
    void registerNeedRect(KisNodeSP node, NodePosition position) {
 
123
        KisBaseRectsWalker::registerNeedRect(node, position);
 
124
 
 
125
        KisCloneLayerSP cloneLayer = qobject_cast<KisCloneLayer*>(node.data());
 
126
        if(cloneLayer) {
 
127
            /**
 
128
             * We need to check whether the source of the clone is going
 
129
             * to be updated after the clone itself. If so we need to
 
130
             * pre-update it manually. This can be checked by the precedence
 
131
             * of the source in the nodes stack
 
132
             */
 
133
            if(isRegistered(cloneLayer->copyFrom())) {
 
134
                registerNeedRect(cloneLayer->copyFrom(), N_EXTRA | N_FILTHY);
 
135
            }
 
136
        }
 
137
    }
 
138
 
 
139
    bool isRegistered(KisNodeSP node) {
 
140
        foreach(const JobItem &item, nodeStack()) {
 
141
            if(item.m_node == node)
 
142
                return true;
 
143
        }
 
144
        return false;
 
145
    }
119
146
};
120
147
 
121
148