Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/gpuvis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,9 @@ void MainApp::render()
{
{ "Ctrl+click drag", "Graph: Select area" },
{ "Shift+click drag", "Graph: Zoom selected area" },
{ "Mousewheel", "Graph: Zoom in / out" },
{ "Mousewheel", "Graph: Pan up / down" },
{ "Shift+mousewheel", "Graph: Pan left / right" },
{ "Ctrl+mousewheel", "Graph: Zoom in / out" },
{ "Alt down", "Graph: Hide labels" },
};
int graph_entry_count = 0;
Expand Down
21 changes: 19 additions & 2 deletions src/gpuvis_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4714,9 +4714,26 @@ void TraceWin::graph_handle_mouse_over( graph_info_t &gi )
}
else if ( io.MouseWheel )
{
bool zoomin = ( io.MouseWheel > 0.0f );
// wheel: move vertically
// shift + wheel: move horizontally
// alt + wheel: zoom
uint32_t mask = ( io.KeyCtrl << 0 ) | ( io.KeyAlt << 1 ) | ( io.KeyShift << 2 );

if ( mask == ( 1 << 0 ) )
{
bool zoomin = ( io.MouseWheel > 0.0f );

graph_zoom( mouse_ts, gi.ts0, zoomin );
graph_zoom( mouse_ts, gi.ts0, zoomin );
}
else if ( mask == ( 1 << 2 ))
{
m_graph.start_ts += (int64_t)(io.MouseWheel * m_graph.length_ts / 10);
m_graph.recalc_timebufs = true;
}
else if ( mask == 0 )
{
m_graph.start_y += io.MouseWheel * ImGui::GetTextLineHeightWithSpacing() * 4;
}
}
}

Expand Down