Mouse scroll over playback image also changes frame.

This commit is contained in:
Bartosz Taudul 2022-04-22 21:59:27 +02:00
parent d9684dcb71
commit 9757fcc0ef
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -15695,13 +15695,17 @@ void View::DrawPlayback()
ImGui::Image( m_playback.texture, ImVec2( fi->w * scale, fi->h * scale ) );
}
}
int tmp = m_playback.frame + 1;
bool changed = ImGui::SliderInt( "Frame image", &tmp, 1, ficnt, "%d" );
ImGui::SetItemUsingMouseWheel();
if( ImGui::IsItemHovered() )
{
const auto wheel = ImGui::GetIO().MouseWheel;
if( wheel )
bool changed = false;
int tmp = m_playback.frame + 1;
if( wheel && ImGui::IsItemHovered() )
{
tmp -= (int)wheel;
changed = true;
}
changed |= ImGui::SliderInt( "Frame image", &tmp, 1, ficnt, "%d" );
ImGui::SetItemUsingMouseWheel();
if( wheel && ImGui::IsItemHovered() )
{
if( ImGui::IsItemActive() )
{
@ -15713,7 +15717,6 @@ void View::DrawPlayback()
changed = true;
}
}
}
if( changed )
{
if( tmp < 1 ) tmp = 1;