Keep internal time and progress accounting in sync. Spotted
by Martin Graesslin. BUG: 161434 CCMAIL: ubuntu@martin-graesslin.com svn path=/trunk/KDE/kdebase/workspace/; revision=803465
This commit is contained in:
parent
d09306ae55
commit
cc11082706
1 changed files with 3 additions and 0 deletions
|
@ -925,11 +925,13 @@ double TimeLine::valueForTime(const int msec) const
|
|||
void TimeLine::addTime(const int msec)
|
||||
{
|
||||
m_Time = qMin(m_Duration, m_Time + msec);
|
||||
m_Progress = m_Time / m_Duration;
|
||||
}
|
||||
|
||||
void TimeLine::removeTime(const int msec)
|
||||
{
|
||||
m_Time = qMax(0, m_Time - msec);
|
||||
m_Progress = m_Time / m_Duration;
|
||||
}
|
||||
|
||||
void TimeLine::setProgress(const double progress)
|
||||
|
@ -946,6 +948,7 @@ double TimeLine::progress() const
|
|||
void TimeLine::addProgress(const double progress)
|
||||
{
|
||||
m_Progress += progress;
|
||||
m_Time = (int)(m_Duration * m_Progress);
|
||||
}
|
||||
|
||||
void TimeLine::setCurveShape(CurveShape curveShape)
|
||||
|
|
Loading…
Reference in a new issue