diff --git a/src/gpuvis.cpp b/src/gpuvis.cpp index 68ce704..e9838d2 100644 --- a/src/gpuvis.cpp +++ b/src/gpuvis.cpp @@ -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; diff --git a/src/gpuvis_graph.cpp b/src/gpuvis_graph.cpp index 3b64bd6..4477f3e 100644 --- a/src/gpuvis_graph.cpp +++ b/src/gpuvis_graph.cpp @@ -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; + } } }