support more directions
svn path=/trunk/KDE/kdelibs/; revision=1041173
This commit is contained in:
parent
28bab1f99d
commit
151b9d92bb
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user