Commit cbe3963d authored by Denis Kuplyakov's avatar Denis Kuplyakov
Browse files

Corrected delay for move timer.

Now m_delay is synced to animation speed time and not just 500ms.
parent f80223bc
......@@ -21,7 +21,7 @@
#include "kreversiscene.h"
KReversiView::KReversiView(KReversiGame* game, QWidget *parent) :
KgDeclarativeView(parent), m_delay(500), m_game(0),
KgDeclarativeView(parent), m_delay(ANIMATION_SPEED_NORMAL), m_game(0),
m_demoMode(false), m_showLastMove(false), m_showLegalMoves(false),
m_showLabels(false)
{
......@@ -83,7 +83,7 @@ void KReversiView::setShowBoardLabels(bool show)
void KReversiView::setAnimationSpeed(int speed)
{
int value;
int value = ANIMATION_SPEED_NORMAL;
switch (speed) {
case 0:
value = ANIMATION_SPEED_SLOW;
......@@ -97,6 +97,8 @@ void KReversiView::setAnimationSpeed(int speed)
break;
}
m_delay = value;
QMetaObject::invokeMethod(m_qml_root, "setAnimationTime",
Q_ARG(QVariant, value));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment