From 84abfadc72068ca6decaaeafb86ea3abc4ac3c3c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 15 Oct 2017 16:20:45 +0200 Subject: [PATCH] Horizontal zone view dragging with RMB. --- server/TracyView.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index bfa00a1c..722f2b31 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1495,15 +1495,21 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d if( ImGui::IsMouseDragging( 1, 0 ) ) { m_pause = true; - const auto delta = ImGui::GetMouseDragDelta( 1, 0 ).x; + const auto delta = ImGui::GetMouseDragDelta( 1, 0 ); const auto nspx = double( timespan ) / w; - const auto dpx = int64_t( delta * nspx ); + const auto dpx = int64_t( delta.x * nspx ); if( dpx != 0 ) { m_zvStart -= dpx; m_zvEnd -= dpx; io.MouseClickedPos[1].x = io.MousePos.x; } + if( delta.y != 0 ) + { + auto y = ImGui::GetScrollY(); + ImGui::SetScrollY( y - delta.y ); + io.MouseClickedPos[1].y = io.MousePos.y; + } } const auto wheel = io.MouseWheel;