support more directions

svn path=/trunk/KDE/kdelibs/; revision=1041173
This commit is contained in:
Igor Trindade Oliveira 2009-10-27 14:33:17 +00:00
parent 28bab1f99d
commit 151b9d92bb

View File

@ -42,7 +42,7 @@ QAbstractAnimation* SlideAnimation::render(QObject* parent)
qreal newX = x; qreal newX = x;
qreal newY = y; qreal newY = y;
kDebug()<<direction( ); kDebug()<<direction();
switch (direction()) { switch (direction()) {
case MoveUp: case MoveUp:
newY -= distance(); newY -= distance();
@ -61,12 +61,29 @@ QAbstractAnimation* SlideAnimation::render(QObject* parent)
break; break;
case MoveUpRight: case MoveUpRight:
case MoveDownRight: newX += distance();
case MoveDownLeft: newY -= distance();
case MoveUpLeft:
/* TODO: support compound directions */
kDebug() << "Compound directions (UpRight, DownRight, DownLeft, UpLeft) are not supported";
break; break;
case MoveDownRight:
newX += distance();
newY += distance();
break;
case MoveDownLeft:
newX -= distance();
newY += distance();
break;
case MoveUpLeft:
newX -= distance();
newY -= distance();
break;
default:
kDebug()<<"Compound direction is not supported";
return 0;
} }
//Recreate only if needed //Recreate only if needed