From 21fd14397d3ad20ca4a7c164bc281f4733791af2 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 22 Sep 2017 21:39:14 +0200 Subject: [PATCH] Accumulate drag offset if time delta is less than 1 ns. --- server/TracyView.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8ccbf8d1..c190c3bc 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -755,9 +755,13 @@ void View::DrawZones() m_pause = true; const auto delta = ImGui::GetMouseDragDelta( 1, 0 ).x; const auto nspx = double( timespan ) / w; - m_zvStart -= int64_t( delta * nspx ); - m_zvEnd -= int64_t( delta * nspx ); - io.MouseClickedPos[1].x = io.MousePos.x; + const auto dpx = int64_t( delta * nspx ); + if( dpx != 0 ) + { + m_zvStart -= dpx; + m_zvEnd -= dpx; + io.MouseClickedPos[1].x = io.MousePos.x; + } } const auto wheel = io.MouseWheel;