Make sure m_Progress is always double. Fixes restoring of

windows for me. Minimizing still doesn't animate here. :/

If someone sees the same problem, please let me know. There
also seems to be something fishy with the desktopgrid --
it's not showing windows on inactive desktops, sliding
animation and the grid-zoomout expose this.

svn path=/trunk/KDE/kdebase/workspace/; revision=804806
This commit is contained in:
Sebastian Kügler 2008-05-06 23:03:23 +00:00
parent f9ce0427e8
commit cac8ff3072
2 changed files with 13 additions and 3 deletions

View file

@ -925,19 +925,19 @@ 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;
m_Progress = (double)m_Time / m_Duration;
}
void TimeLine::removeTime(const int msec)
{
m_Time = qMax(0, m_Time - msec);
m_Progress = m_Time / m_Duration;
m_Progress = (double)m_Time / m_Duration;
}
void TimeLine::setProgress(const double progress)
{
m_Progress = progress;
m_Time = (int)(m_Duration * progress);
m_Time = qRound(m_Duration * progress);
}
double TimeLine::progress() const
@ -945,6 +945,11 @@ double TimeLine::progress() const
return m_Progress;
}
int TimeLine::time() const
{
return m_Time;
}
void TimeLine::addProgress(const double progress)
{
m_Progress += progress;

View file

@ -1084,6 +1084,11 @@ class KWIN_EXPORT TimeLine
* and related methods, the y value of the current state x.
*/
double valueForTime(const int msec) const;
/**
* Returns the current time of the TimeLine, between 0 and duration()
* The value returned is equivalent to the x-axis on a curve.
*/
int time() const;
/**
* Returns the progress of the TimeLine, between 0.0 and 1.0.
* The value returned is equivalent to the y-axis on a curve.