mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 16:54:35 +00:00
Clamp scrolling to the difference between the deepest zone near the mouse, and the height of the window.
This prevents from unncessary scrolling when the trace does not exceed the size of the screen
This commit is contained in:
parent
33a640f848
commit
a8b42488ad
@ -160,7 +160,7 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool
|
|||||||
|
|
||||||
if( const auto scrollY = CalculateScrollPosition() )
|
if( const auto scrollY = CalculateScrollPosition() )
|
||||||
{
|
{
|
||||||
int clampedScrollY = std::min<int>( *scrollY, yOffset );
|
int clampedScrollY = std::min<int>( *scrollY, std::max<int>( yOffset - ImGui::GetWindowHeight(), 0 ) );
|
||||||
ImGui::SetScrollY( clampedScrollY );
|
ImGui::SetScrollY( clampedScrollY );
|
||||||
int minHeight = ImGui::GetWindowHeight() + clampedScrollY;
|
int minHeight = ImGui::GetWindowHeight() + clampedScrollY;
|
||||||
yOffset = std::max( yOffset, minHeight );
|
yOffset = std::max( yOffset, minHeight );
|
||||||
|
Loading…
Reference in New Issue
Block a user