Set of changes:
- moved transformation reference inside of the the shadow pulse class - ensuring that the local pointer in pulser will correctly point to the shadow object - recreating the pixmap if the animated widget geometry has changed svn path=/trunk/KDE/kdelibs/; revision=1050711
This commit is contained in:
parent
2bfcef80ab
commit
acda971fa0
@ -82,6 +82,8 @@ void PulseAnimation::setCopy()
|
|||||||
ShadowFake *shadow = 0;
|
ShadowFake *shadow = 0;
|
||||||
if (!d->under)
|
if (!d->under)
|
||||||
shadow = new ShadowFake;
|
shadow = new ShadowFake;
|
||||||
|
else
|
||||||
|
shadow = dynamic_cast<ShadowFake*>(d->under);
|
||||||
|
|
||||||
shadow->copyTarget(target);
|
shadow->copyTarget(target);
|
||||||
|
|
||||||
@ -125,10 +127,6 @@ void PulseAnimation::createAnimation(qreal duration, qreal scale)
|
|||||||
d->opacityAnimation->setEndValue(0);
|
d->opacityAnimation->setEndValue(0);
|
||||||
group->addAnimation(d->opacityAnimation);
|
group->addAnimation(d->opacityAnimation);
|
||||||
|
|
||||||
QRectF initial(d->under->geometry());
|
|
||||||
QPointF tmp(initial.width() * 0.5, initial.height() * 0.5);
|
|
||||||
d->under->setTransformOriginPoint(tmp);
|
|
||||||
|
|
||||||
d->scaleAnimation = new QPropertyAnimation(d->under, "scale");
|
d->scaleAnimation = new QPropertyAnimation(d->under, "scale");
|
||||||
d->scaleAnimation->setDuration(duration);
|
d->scaleAnimation->setDuration(duration);
|
||||||
d->scaleAnimation->setStartValue(d->mscale);
|
d->scaleAnimation->setStartValue(d->mscale);
|
||||||
@ -149,12 +147,8 @@ void PulseAnimation::createAnimation(qreal duration, qreal scale)
|
|||||||
* and *then* reset the geometry
|
* and *then* reset the geometry
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
if ((*d->pulseGeometry) != widgetToAnimate()->geometry()) {
|
if ((*d->pulseGeometry) != widgetToAnimate()->geometry())
|
||||||
/*FIXME: it crashes when deleting old the image in ShadowFake
|
setCopy();
|
||||||
* setCopy();
|
|
||||||
*/
|
|
||||||
qDebug() << "PulseAnimation:: it should update the geom....";
|
|
||||||
}
|
|
||||||
|
|
||||||
d->opacityAnimation->setEndValue(0);
|
d->opacityAnimation->setEndValue(0);
|
||||||
d->scaleAnimation->setEndValue(scale);
|
d->scaleAnimation->setEndValue(scale);
|
||||||
|
@ -38,6 +38,10 @@ ShadowFake::~ShadowFake()
|
|||||||
|
|
||||||
void ShadowFake::copyTarget(QGraphicsWidget *target)
|
void ShadowFake::copyTarget(QGraphicsWidget *target)
|
||||||
{
|
{
|
||||||
|
QRectF initial(target->geometry());
|
||||||
|
QPointF tmp(initial.width() * 0.5, initial.height() * 0.5);
|
||||||
|
setTransformOriginPoint(tmp);
|
||||||
|
|
||||||
setParentItem(target);
|
setParentItem(target);
|
||||||
setGeometry(target->geometry());
|
setGeometry(target->geometry());
|
||||||
QSize size(target->size().toSize());
|
QSize size(target->size().toSize());
|
||||||
|
Loading…
Reference in New Issue
Block a user