mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Use ctrl key to zoom-out using selection range.
This commit is contained in:
parent
1cf168c95e
commit
2eddbeb164
@ -776,8 +776,22 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d
|
|||||||
{
|
{
|
||||||
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 );
|
||||||
|
|
||||||
// ZoomToRange disables m_highlightZoom.active
|
// ZoomToRange disables m_highlightZoom.active
|
||||||
ZoomToRange( s, e );
|
if( io.KeyCtrl )
|
||||||
|
{
|
||||||
|
const auto tsOld = m_zvEnd - m_zvStart;
|
||||||
|
const auto tsNew = e - s;
|
||||||
|
const auto mul = double( tsOld ) / tsNew;
|
||||||
|
const auto left = s - m_zvStart;
|
||||||
|
const auto right = m_zvEnd - e;
|
||||||
|
|
||||||
|
ZoomToRange( m_zvStart - left * mul, m_zvEnd + right * mul );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ZoomToRange( s, e );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ImGui::IsMouseDragging( 1, 0 ) )
|
if( ImGui::IsMouseDragging( 1, 0 ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user