1
1
/* This file is part of the KDE project
2
* Copyright (C) 2006, 2009 Thomas Zander <zander@kde.org>
2
* Copyright (C) 2006, 2009,2010 Thomas Zander <zander@kde.org>
4
4
* This library is free software; you can redistribute it and/or
5
5
* modify it under the terms of the GNU Library General Public
35
36
m_pageManager(pageManager)
37
38
setSize(m_original->size());
39
// allow selecting me to get the tool for the original to still work.
40
QSet<KoShape*> delegates;
41
delegates << m_original;
42
setToolDelegates(delegates);
40
45
KWCopyShape::~KWCopyShape()
63
//paint the original shape
59
65
m_original->paint(painter, converter);
61
if (m_original->border())
62
m_original->border()->paintBorder(m_original, painter, converter);
67
if (m_original->border()) {
68
m_original->border()->paint(m_original, painter, converter);
71
//paint all child shapes
72
KoShapeContainer* container = dynamic_cast<KoShapeContainer*>(m_original);
74
if (!container->childCount()) {
78
QList<KoShape*> sortedObjects = container->childShapes();
79
qSort(sortedObjects.begin(), sortedObjects.end(), KoShape::compareShapeZIndex);
81
// Do the following to revert the absolute transformation of the
82
// container that is re-applied in shape->absoluteTransformation()
83
// later on. The transformation matrix of the container has already
84
// been applied once before this function is called.
85
QMatrix baseMatrix = container->absoluteTransformation(&converter).inverted() * painter.matrix();
87
foreach(KoShape *shape, sortedObjects) {
89
painter.setMatrix(shape->absoluteTransformation(&converter) * baseMatrix);
90
shape->paint(painter, converter);
92
if (shape->border()) {
94
painter.setMatrix(shape->absoluteTransformation(&converter) * baseMatrix);
95
shape->border()->paint(shape, painter, converter);
65
102
void KWCopyShape::paintDecorations(QPainter &painter, const KoViewConverter &converter, const KoCanvasBase *canvas)