From 57ce41d9664bfe03fe75f77dcc41949370a9cc31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 25 May 2012 22:57:51 +0200 Subject: [PATCH] move a variable to correct context BUG: 297757 FIXED-IN: 4.9 REVIEW: 105058 --- effects/coverswitch/coverswitch.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index e336b233ac..0f30927ff7 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -790,6 +790,7 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i if (rightWindows == 0) { rightWindows = 1; } + RotationData rot; // this has to survive the if (animation) context as it's used as pointer - bug #297757 if (animation) { float distance = 0.0; if (direction == Right) { @@ -797,7 +798,6 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i distance = -frontWindow->geometry().width() * 0.5f + area.width() * 0.5f + (((float)displayWidth() * 0.5 * scaleFactor) - (float)area.width() * 0.5f) / rightWindows; data.xTranslate += distance * timeLine.currentValue(); - RotationData rot; rot.axis = RotationData::YAxis; rot.angle = -angle * timeLine.currentValue(); rot.xRotationPoint = frontWindow->geometry().width(); @@ -810,9 +810,9 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i if (specialHandlingForward) factor = 2.0; data.xTranslate += distance * timeLine.currentValue() * factor; - RotationData rot; rot.axis = RotationData::YAxis; rot.angle = angle * timeLine.currentValue(); + rot.xRotationPoint = 0.0; data.rotation = &rot; } } @@ -845,8 +845,10 @@ void CoverSwitchEffect::paintWindows(const EffectWindowList& windows, bool left, rot.angle = angle; rot.angle = angle * rotateFactor; WindowPaintData data(additionalWindow); - if (left) + if (left) { data.xTranslate += -xTranslate - additionalWindow->geometry().x(); + rot.xRotationPoint = 0.0; + } else { data.xTranslate += xTranslate + area.width() - additionalWindow->geometry().x() - additionalWindow->geometry().width();