mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Merge pull request #446 from simplyWiri/master
Add WASD panning/zooming functionality to timeline.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef __TRACYVIEW_HPP__
|
||||
#define __TRACYVIEW_HPP__
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
@@ -145,6 +146,23 @@ private:
|
||||
Inactive
|
||||
};
|
||||
|
||||
struct KeyboardNavigation {
|
||||
enum Direction : uint8_t {
|
||||
// Pan left / right
|
||||
Left,
|
||||
Right,
|
||||
// Zoom in / out
|
||||
In,
|
||||
Out
|
||||
};
|
||||
|
||||
constexpr static auto DirectionToKeyMap = std::array<int, 4>{ImGuiKey_A, ImGuiKey_D, ImGuiKey_W, ImGuiKey_S};
|
||||
constexpr static auto StartRangeMod = std::array<int, 4>{-1, 1, 1, -1};
|
||||
constexpr static auto EndRangeMod = std::array<int, 4>{-1, 1, -1, 1};
|
||||
|
||||
std::array<float, 4> m_scrollInertia;
|
||||
};
|
||||
|
||||
struct ZoneColorData
|
||||
{
|
||||
uint32_t color;
|
||||
@@ -375,6 +393,7 @@ private:
|
||||
|
||||
ViewData m_vd;
|
||||
TimelineController m_tc;
|
||||
KeyboardNavigation m_kbNavCtrl;
|
||||
|
||||
const ZoneEvent* m_zoneInfoWindow = nullptr;
|
||||
const ZoneEvent* m_zoneHighlight;
|
||||
|
||||
Reference in New Issue
Block a user