Improve zooming animation.

This commit is contained in:
Bartosz Taudul 2019-02-21 20:00:29 +01:00
parent b33c61cead
commit bc713463d8
2 changed files with 1 additions and 7 deletions

View File

@ -897,7 +897,7 @@ bool View::DrawImpl()
if( m_zoomAnim.active )
{
m_zoomAnim.progress += io.DeltaTime * m_zoomAnim.lenMod;
m_zoomAnim.progress += io.DeltaTime * 3.33f;
if( m_zoomAnim.progress >= 1.f )
{
m_zoomAnim.active = false;
@ -8938,11 +8938,6 @@ void View::ZoomToRange( int64_t start, int64_t end )
m_zoomAnim.end0 = m_zvEnd;
m_zoomAnim.end1 = end;
m_zoomAnim.progress = 0;
const auto d0 = double( m_zoomAnim.end0 - m_zoomAnim.start0 );
const auto d1 = double( m_zoomAnim.end1 - m_zoomAnim.start1 );
const auto diff = d0>d1 ? d0/d1 : d1/d0;
m_zoomAnim.lenMod = 10.0 / log10( diff );
}
void View::ZoomToPrevFrame()

View File

@ -33,7 +33,6 @@ class View
int64_t start0, start1;
int64_t end0, end1;
double progress;
double lenMod;
};
struct Region