move a variable to correct context

BUG: 297757
FIXED-IN: 4.9
REVIEW: 105058
This commit is contained in:
Thomas Lübking 2012-05-25 22:57:51 +02:00
parent d546fea565
commit 57ce41d966

View file

@ -790,6 +790,7 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i
if (rightWindows == 0) { if (rightWindows == 0) {
rightWindows = 1; rightWindows = 1;
} }
RotationData rot; // this has to survive the if (animation) context as it's used as pointer - bug #297757
if (animation) { if (animation) {
float distance = 0.0; float distance = 0.0;
if (direction == Right) { 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 + distance = -frontWindow->geometry().width() * 0.5f + area.width() * 0.5f +
(((float)displayWidth() * 0.5 * scaleFactor) - (float)area.width() * 0.5f) / rightWindows; (((float)displayWidth() * 0.5 * scaleFactor) - (float)area.width() * 0.5f) / rightWindows;
data.xTranslate += distance * timeLine.currentValue(); data.xTranslate += distance * timeLine.currentValue();
RotationData rot;
rot.axis = RotationData::YAxis; rot.axis = RotationData::YAxis;
rot.angle = -angle * timeLine.currentValue(); rot.angle = -angle * timeLine.currentValue();
rot.xRotationPoint = frontWindow->geometry().width(); rot.xRotationPoint = frontWindow->geometry().width();
@ -810,9 +810,9 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i
if (specialHandlingForward) if (specialHandlingForward)
factor = 2.0; factor = 2.0;
data.xTranslate += distance * timeLine.currentValue() * factor; data.xTranslate += distance * timeLine.currentValue() * factor;
RotationData rot;
rot.axis = RotationData::YAxis; rot.axis = RotationData::YAxis;
rot.angle = angle * timeLine.currentValue(); rot.angle = angle * timeLine.currentValue();
rot.xRotationPoint = 0.0;
data.rotation = &rot; data.rotation = &rot;
} }
} }
@ -845,8 +845,10 @@ void CoverSwitchEffect::paintWindows(const EffectWindowList& windows, bool left,
rot.angle = angle; rot.angle = angle;
rot.angle = angle * rotateFactor; rot.angle = angle * rotateFactor;
WindowPaintData data(additionalWindow); WindowPaintData data(additionalWindow);
if (left) if (left) {
data.xTranslate += -xTranslate - additionalWindow->geometry().x(); data.xTranslate += -xTranslate - additionalWindow->geometry().x();
rot.xRotationPoint = 0.0;
}
else { else {
data.xTranslate += xTranslate + area.width() - data.xTranslate += xTranslate + area.width() -
additionalWindow->geometry().x() - additionalWindow->geometry().width(); additionalWindow->geometry().x() - additionalWindow->geometry().width();