1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 13:13:53 +00:00

Fix time range limits created by reverse-mouse-drag.

This commit is contained in:
Bartosz Taudul 2020-08-07 00:24:22 +02:00
parent e18e9411f3
commit 550e05d149

View File

@ -773,23 +773,23 @@ bool View::DrawImpl()
} }
if( ImGui::BeginPopup( "SetZoneRange" ) ) if( ImGui::BeginPopup( "SetZoneRange" ) )
{ {
const auto s = std::min( m_setRangePopup.min, m_setRangePopup.max );
const auto e = std::max( m_setRangePopup.min, m_setRangePopup.max );
if( ImGui::Selectable( ICON_FA_SEARCH " Limit find zone time range" ) ) if( ImGui::Selectable( ICON_FA_SEARCH " Limit find zone time range" ) )
{ {
m_findZone.range.active = true; m_findZone.range.active = true;
m_findZone.range.min = m_setRangePopup.min; m_findZone.range.min = s;
m_findZone.range.max = m_setRangePopup.max; m_findZone.range.max = e;
} }
if( ImGui::Selectable( ICON_FA_SORT_AMOUNT_UP " Limit statistics time range" ) ) if( ImGui::Selectable( ICON_FA_SORT_AMOUNT_UP " Limit statistics time range" ) )
{ {
m_statRange.active = true; m_statRange.active = true;
m_statRange.min = m_setRangePopup.min; m_statRange.min = s;
m_statRange.max = m_setRangePopup.max; m_statRange.max = e;
} }
if( ImGui::Selectable( ICON_FA_STICKY_NOTE " Add annotation" ) ) if( ImGui::Selectable( ICON_FA_STICKY_NOTE " Add annotation" ) )
{ {
auto ann = std::make_unique<Annotation>(); auto ann = std::make_unique<Annotation>();
const auto s = std::min( m_setRangePopup.min, m_setRangePopup.max );
const auto e = std::max( m_setRangePopup.min, m_setRangePopup.max );
ann->range.active = true; ann->range.active = true;
ann->range.min = s; ann->range.min = s;
ann->range.max = e; ann->range.max = e;