Commit d58cceb7 authored by Jan Hambrecht's avatar Jan Hambrecht

take filter stack into account when calculating bounding rect


svn path=/trunk/koffice/; revision=1007534
parent 5a2df7f3
......@@ -31,6 +31,7 @@
#include "KoShapeShadow.h"
#include "KoShapeBackground.h"
#include "KoShapeContainer.h"
#include "KoFilterEffectStack.h"
#include <KoXmlReader.h>
#include <KoXmlWriter.h>
......@@ -376,6 +377,10 @@ QRectF KoPathShape::boundingRect() const
shadow()->insets(this, insets);
bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
}
if (filterEffectStack()) {
QRectF clipRect = filterEffectStack()->clipRectForBoundingRect(QRectF(QPointF(), size()));
bb |= transform.mapRect(clipRect);
}
return bb;
}
......
......@@ -300,18 +300,25 @@ bool KoShape::hitTest(const QPointF &position) const
QRectF KoShape::boundingRect() const
{
Q_D(const KoShape);
QRectF bb(QPointF(0, 0), size());
QSizeF mySize = size();
QMatrix transform = absoluteTransformation(0);
QRectF bb(QPointF(0, 0), mySize);
if (d->border) {
KoInsets insets;
d->border->borderInsets(this, insets);
bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
}
bb = absoluteTransformation(0).mapRect(bb);
bb = transform.mapRect(bb);
if (d->shadow) {
KoInsets insets;
d->shadow->insets(this, insets);
bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
}
if (d->filterEffectStack) {
QRectF clipRect = d->filterEffectStack->clipRectForBoundingRect(QRectF(QPointF(), mySize));
bb |= transform.mapRect(clipRect);
}
return bb;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment