~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to krita/ui/flake/kis_shape_selection_model.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-07-16 10:51:29 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20120716105129-es1ebubwiwlsfvv0
Tags: 1:2.4.92-0ubuntu1
New upstream RC release

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "kis_undo_adapter.h"
30
30
 
31
31
KisShapeSelectionModel::KisShapeSelectionModel(KisImageWSP image, KisSelectionWSP selection, KisShapeSelection* shapeSelection)
32
 
        : m_image(image)
33
 
        , m_parentSelection(selection)
34
 
        , m_shapeSelection(shapeSelection)
 
32
    : m_image(image)
 
33
    , m_parentSelection(selection)
 
34
    , m_shapeSelection(shapeSelection)
35
35
{
36
36
}
37
37
 
43
43
 
44
44
void KisShapeSelectionModel::add(KoShape *child)
45
45
{
 
46
    if (!m_shapeSelection) return;
 
47
 
46
48
    if (m_shapeMap.contains(child))
47
49
        return;
48
50
 
71
73
 
72
74
void KisShapeSelectionModel::remove(KoShape *child)
73
75
{
 
76
    if (!m_shapeMap.contains(child)) return;
 
77
 
74
78
    QRect updateRect = child->boundingRect().toAlignedRect();
75
79
    m_shapeMap.remove(child);
76
80
 
84
88
    updateRect = matrix.mapRect(updateRect);
85
89
    if (m_shapeSelection) { // No m_shapeSelection indicates the selection is being deleted
86
90
        m_parentSelection->updateProjection(updateRect);
 
91
        m_image->undoAdapter()->emitSelectionChanged();
87
92
    }
88
93
 
89
 
    m_image->undoAdapter()->emitSelectionChanged();
90
94
}
91
95
 
92
96
void KisShapeSelectionModel::setClipped(const KoShape *child, bool clipping)
128
132
 
129
133
void KisShapeSelectionModel::childChanged(KoShape * child, KoShape::ChangeType type)
130
134
{
131
 
    if (type == KoShape::ParentChanged)
132
 
        return;
 
135
    if (!m_shapeSelection) return;
 
136
    if (type == KoShape::ParentChanged) return;
133
137
 
134
138
    m_shapeSelection->setDirty();
135
139
    QRectF changedRect = m_shapeMap[child];