mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 12:53:51 +00:00
Enable playback frame change with mouse wheel.
This commit is contained in:
parent
176bc279f1
commit
1002e949d6
@ -15509,7 +15509,25 @@ void View::DrawPlayback()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
int tmp = m_playback.frame + 1;
|
int tmp = m_playback.frame + 1;
|
||||||
if( ImGui::SliderInt( "Frame image", &tmp, 1, ficnt, "%d" ) )
|
bool changed = ImGui::SliderInt( "Frame image", &tmp, 1, ficnt, "%d" );
|
||||||
|
ImGui::SetItemUsingMouseWheel();
|
||||||
|
if( ImGui::IsItemHovered() )
|
||||||
|
{
|
||||||
|
const auto wheel = ImGui::GetIO().MouseWheel;
|
||||||
|
if( wheel )
|
||||||
|
{
|
||||||
|
if( ImGui::IsItemActive() )
|
||||||
|
{
|
||||||
|
ImGui::ClearActiveID();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tmp -= (int)wheel;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( changed )
|
||||||
{
|
{
|
||||||
if( tmp < 1 ) tmp = 1;
|
if( tmp < 1 ) tmp = 1;
|
||||||
else if( (uint32_t)tmp > ficnt ) tmp = ficnt;
|
else if( (uint32_t)tmp > ficnt ) tmp = ficnt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user