mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Proper way to detect mouse hover over timeline.
This commit is contained in:
parent
86c2574848
commit
77e39700b1
@ -287,8 +287,8 @@ void View::DrawTimeline()
|
|||||||
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
|
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
|
||||||
const auto h = std::max<float>( m_vd.zvHeight, ImGui::GetContentRegionAvail().y - 4 ); // magic border value
|
const auto h = std::max<float>( m_vd.zvHeight, ImGui::GetContentRegionAvail().y - 4 ); // magic border value
|
||||||
|
|
||||||
ImGui::InvisibleButton( "##zones", ImVec2( w, h ) );
|
ImGui::ItemSize( ImVec2( w, h ) );
|
||||||
bool hover = ImGui::IsItemHovered();
|
bool hover = ImGui::IsWindowHovered() && ImGui::IsMouseHoveringRect( wpos, wpos + ImVec2( w, h ) );
|
||||||
draw = ImGui::GetWindowDrawList();
|
draw = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
const auto nspx = 1.0 / pxns;
|
const auto nspx = 1.0 / pxns;
|
||||||
|
Loading…
Reference in New Issue
Block a user