diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 012ee287..c917c44d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -10024,14 +10024,16 @@ void View::DrawGoToFrame() const auto numFrames = mainFrameSet ? m_frames->frames.size() - 1 : m_frames->frames.size(); const auto frameOffset = mainFrameSet ? 0 : 1; + bool goClicked = false; ImGui::Begin( "Go to frame", &m_goToFrame, ImGuiWindowFlags_AlwaysAutoResize ); - ImGui::InputInt( "Frame", &frameNum ); + goClicked |= ImGui::InputInt( "Frame", &frameNum, 1, 100, ImGuiInputTextFlags_EnterReturnsTrue ); frameNum = std::min( std::max( frameNum, 1 ), int( numFrames ) ); #ifdef TRACY_EXTENDED_FONT - if( ImGui::Button( ICON_FA_CROSSHAIRS " Go to" ) ) + goClicked |= ImGui::Button( ICON_FA_CROSSHAIRS " Go to" ); #else - if( ImGui::Button( "Go to" ) ) + goClicked |= ImGui::Button( "Go to" ); #endif + if( goClicked ) { ZoomToRange( m_worker.GetFrameBegin( *m_frames, frameNum - frameOffset ), m_worker.GetFrameEnd( *m_frames, frameNum - frameOffset ) ); }