From 77e39700b1fae71e6737900f9fee5132c67082b7 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 14 Aug 2022 17:17:51 +0200 Subject: [PATCH] Proper way to detect mouse hover over timeline. --- server/TracyView_Timeline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/TracyView_Timeline.cpp b/server/TracyView_Timeline.cpp index 5aba0736..9fe36fd4 100644 --- a/server/TracyView_Timeline.cpp +++ b/server/TracyView_Timeline.cpp @@ -287,8 +287,8 @@ void View::DrawTimeline() const auto dpos = wpos + ImVec2( 0.5f, 0.5f ); const auto h = std::max( m_vd.zvHeight, ImGui::GetContentRegionAvail().y - 4 ); // magic border value - ImGui::InvisibleButton( "##zones", ImVec2( w, h ) ); - bool hover = ImGui::IsItemHovered(); + ImGui::ItemSize( ImVec2( w, h ) ); + bool hover = ImGui::IsWindowHovered() && ImGui::IsMouseHoveringRect( wpos, wpos + ImVec2( w, h ) ); draw = ImGui::GetWindowDrawList(); const auto nspx = 1.0 / pxns;