mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 14:54:34 +00:00
Prevent range-zoom when range has zero length.
This commit is contained in:
parent
b92087bd95
commit
1b44b31eff
@ -827,6 +827,8 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d
|
|||||||
m_highlightZoom.end = m_zvStart + ( io.MousePos.x - wpos.x ) * nspx;
|
m_highlightZoom.end = m_zvStart + ( io.MousePos.x - wpos.x ) * nspx;
|
||||||
}
|
}
|
||||||
else if( m_highlightZoom.active )
|
else if( m_highlightZoom.active )
|
||||||
|
{
|
||||||
|
if( m_highlightZoom.start != m_highlightZoom.end )
|
||||||
{
|
{
|
||||||
const auto s = std::min( m_highlightZoom.start, m_highlightZoom.end );
|
const auto s = std::min( m_highlightZoom.start, m_highlightZoom.end );
|
||||||
const auto e = std::max( m_highlightZoom.start, m_highlightZoom.end );
|
const auto e = std::max( m_highlightZoom.start, m_highlightZoom.end );
|
||||||
@ -847,6 +849,11 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d
|
|||||||
ZoomToRange( s, e );
|
ZoomToRange( s, e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_highlightZoom.active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( ImGui::IsMouseDragging( 1, 0 ) )
|
if( ImGui::IsMouseDragging( 1, 0 ) )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user