From 553bbefd19928c400b7dedd3fec21571c7dd4693 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Tue, 8 Jan 2008 00:52:34 +0000 Subject: [PATCH] Fix the jump when the applethandle disappears as well svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=758489 --- applethandle.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/applethandle.cpp b/applethandle.cpp index 69f70a918..4242992f2 100644 --- a/applethandle.cpp +++ b/applethandle.cpp @@ -81,16 +81,18 @@ AppletHandle::AppletHandle(Containment *parent, Applet *applet) AppletHandle::~AppletHandle() { if (m_applet) { - QRectF rect(m_applet->boundingRect()); - QPointF center = rect.center(); + QRectF rect = QRectF(m_applet->pos(), m_applet->size()); + QPointF center = m_applet->mapFromParent(rect.center()); QPointF newPos = transform().inverted().map(m_applet->pos()); m_applet->setPos(mapToParent(newPos)); + QTransform matrix; matrix.translate(center.x(), center.y()); matrix.rotateRadians(m_originalAngle+m_angle); matrix.translate(-center.x(), -center.y()); m_applet->setTransform(matrix); + m_applet->setParentItem(m_containment); } }