aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquicksprite.cpp12
-rw-r--r--src/quick/items/qquickspriteengine_p.h2
-rw-r--r--src/quick/items/qquickspriteimage.cpp2
3 files changed, 9 insertions, 7 deletions
diff --git a/src/quick/items/qquicksprite.cpp b/src/quick/items/qquicksprite.cpp
index e0535ed77e..724bf8fef1 100644
--- a/src/quick/items/qquicksprite.cpp
+++ b/src/quick/items/qquicksprite.cpp
@@ -248,12 +248,14 @@ int QQuickSprite::variedDuration() const //Deals with precedence when multiple d
+ (m_frameDurationVariation * ((qreal)qrand()/RAND_MAX) * 2)
- m_frameDurationVariation;
return qMax(0, m_frames * mspf);
- }
- qWarning() << "Sprite::duration is changing meaning to the full animation duration.";
- qWarning() << "Use Sprite::frameDuration for the old meaning, of per frame duration.";
- qWarning() << "As an interim measure, duration/durationVariation means the same as frameDuration/frameDurationVariation, and you'll get this warning spewed out everywhere to movtivate you.";
+ } else if (duration() >= 0) {
+ qWarning() << "Sprite::duration is changing meaning to the full animation duration.";
+ qWarning() << "Use Sprite::frameDuration for the old meaning, of per frame duration.";
+ qWarning() << "As an interim measure, duration/durationVariation means the same as frameDuration/frameDurationVariation, and you'll get this warning spewed out everywhere to motivate you.";
//Note that the spammyness is due to this being the best location to detect, but also called once each animation loop
- return QQuickStochasticState::variedDuration() * m_frames;
+ return QQuickStochasticState::variedDuration() * m_frames;
+ }
+ return 1000; //When nothing set
}
void QQuickSprite::startImageLoading()
diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h
index 3763509462..00cefbfbc0 100644
--- a/src/quick/items/qquickspriteengine_p.h
+++ b/src/quick/items/qquickspriteengine_p.h
@@ -70,7 +70,7 @@ class Q_AUTOTEST_EXPORT QQuickStochasticState : public QObject //Currently for i
public:
QQuickStochasticState(QObject* parent = 0)
: QObject(parent)
- , m_duration(1000)
+ , m_duration(-1)
, m_durationVariation(0)
, m_randomStart(false)
{
diff --git a/src/quick/items/qquickspriteimage.cpp b/src/quick/items/qquickspriteimage.cpp
index 6edb3ad8c3..2a151d02a8 100644
--- a/src/quick/items/qquickspriteimage.cpp
+++ b/src/quick/items/qquickspriteimage.cpp
@@ -261,7 +261,7 @@ struct SpriteVertices {
The sprite or sprites to draw. Sprites will be scaled to the size of this element.
*/
-//TODO: Implicitly size element to size of first sprite?
+//TODO: Implicitly size element to size of first sprite? or currentSprite?
QQuickSpriteImage::QQuickSpriteImage(QQuickItem *parent) :
QQuickItem(parent)
, m_node(0)