mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
svg document micro-optimization
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
2cd0c19789
commit
fdb323085a
1 changed files with 4 additions and 5 deletions
|
@ -476,11 +476,10 @@ int QSvgTinyDocument::currentFrame() const
|
|||
|
||||
void QSvgTinyDocument::setCurrentFrame(int frame)
|
||||
{
|
||||
int totalFrames = m_fps * m_animationDuration;
|
||||
double framePercentage = frame/double(totalFrames);
|
||||
double timeForFrame = m_animationDuration * framePercentage; //in S
|
||||
timeForFrame *= 1000; //in ms
|
||||
int timeToAdd = int(timeForFrame - m_time.elapsed());
|
||||
const int totalFrames = m_fps * m_animationDuration;
|
||||
const int framePercentage = frame / totalFrames;
|
||||
const int timeForFrame = m_animationDuration * framePercentage * 1000; //in ms
|
||||
const int timeToAdd = timeForFrame - m_time.elapsed();
|
||||
m_time = m_time.addMSecs(timeToAdd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue