mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Mouse scroll over playback image also changes frame.
This commit is contained in:
parent
d9684dcb71
commit
9757fcc0ef
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user