mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Horizontal zone view dragging with RMB.
This commit is contained in:
parent
361643ea8e
commit
84abfadc72
@ -1495,15 +1495,21 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d
|
||||
if( ImGui::IsMouseDragging( 1, 0 ) )
|
||||
{
|
||||
m_pause = true;
|
||||
const auto delta = ImGui::GetMouseDragDelta( 1, 0 ).x;
|
||||
const auto delta = ImGui::GetMouseDragDelta( 1, 0 );
|
||||
const auto nspx = double( timespan ) / w;
|
||||
const auto dpx = int64_t( delta * nspx );
|
||||
const auto dpx = int64_t( delta.x * nspx );
|
||||
if( dpx != 0 )
|
||||
{
|
||||
m_zvStart -= dpx;
|
||||
m_zvEnd -= dpx;
|
||||
io.MouseClickedPos[1].x = io.MousePos.x;
|
||||
}
|
||||
if( delta.y != 0 )
|
||||
{
|
||||
auto y = ImGui::GetScrollY();
|
||||
ImGui::SetScrollY( y - delta.y );
|
||||
io.MouseClickedPos[1].y = io.MousePos.y;
|
||||
}
|
||||
}
|
||||
|
||||
const auto wheel = io.MouseWheel;
|
||||
|
Loading…
Reference in New Issue
Block a user