Commit 5ecefcda authored by Jan Hambrecht's avatar Jan Hambrecht

fix drawing of childs


svn path=/trunk/koffice/; revision=550431
parent 81ace1a1
......@@ -78,8 +78,6 @@ void KoShapeContainer::paint(QPainter &painter, KoViewConverter &converter) {
QMatrix myMatrix = transformationMatrix(&converter);
foreach (KoShape *shape, sorterdObjects) {
if(! shape->isVisible())
return;
if(! childClipped(shape))
continue;
painter.save();
// TODO this is not perfect yet..
......@@ -87,12 +85,15 @@ void KoShapeContainer::paint(QPainter &painter, KoViewConverter &converter) {
// QPolygon clip = (myMatrix * shapeMatrix.inverted()).mapToPolygon(clipRect.toRect());
// painter.setClipRegion(QRegion(clip));
QRectF clipRect(QPointF(0, 0), size());
clipRect = converter.normalToView(clipRect);
if( childClipped(shape) ) {
QPolygon clip = myMatrix.mapToPolygon(clipRect.toRect());
clip.translate( (position() - converter.normalToView(position())).toPoint() );
painter.setClipRegion(QRegion(clip));
QRectF clipRect(QPointF(0, 0), size());
clipRect = converter.normalToView(clipRect);
QPolygon clip = myMatrix.mapToPolygon(clipRect.toRect());
clip.translate( (position() - converter.normalToView(position())).toPoint() );
painter.setClipRegion(QRegion(clip));
}
//qDebug() << "rect: " << position();
//qDebug() << "polygon: " << clip.boundingRect();
//painter.drawPolygon(clip);
......
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