Fix the jump when the applethandle disappears as well

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=758489
This commit is contained in:
Alex Merry 2008-01-08 00:52:34 +00:00
parent 2073330692
commit 553bbefd19

View File

@ -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);
}
}