mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Tweak mouse wheel behavior on Wayland.
This commit is contained in:
parent
b48a9027dd
commit
170a961d8d
@ -71,7 +71,6 @@ static uint64_t s_time;
|
||||
|
||||
static wl_fixed_t s_wheelAxisX, s_wheelAxisY;
|
||||
static bool s_wheel;
|
||||
static bool s_wheelPrecise;
|
||||
|
||||
static void PointerEnter( void*, struct wl_pointer* pointer, uint32_t serial, struct wl_surface* surf, wl_fixed_t sx, wl_fixed_t sy )
|
||||
{
|
||||
@ -121,7 +120,6 @@ static void PointerAxis( void*, struct wl_pointer* pointer, uint32_t time, uint3
|
||||
|
||||
static void PointerAxisSource( void*, struct wl_pointer* pointer, uint32_t source )
|
||||
{
|
||||
if( source == WL_POINTER_AXIS_SOURCE_FINGER ) s_wheelPrecise = true;
|
||||
}
|
||||
|
||||
static void PointerAxisStop( void*, struct wl_pointer* pointer, uint32_t time, uint32_t axis )
|
||||
@ -137,14 +135,10 @@ static void PointerFrame( void*, struct wl_pointer* pointer )
|
||||
if( s_wheel )
|
||||
{
|
||||
s_wheel = false;
|
||||
if( s_wheelPrecise )
|
||||
{
|
||||
s_wheelAxisX /= 8;
|
||||
s_wheelAxisY /= 8;
|
||||
s_wheelPrecise = false;
|
||||
}
|
||||
s_wheelAxisX /= 8;
|
||||
s_wheelAxisY /= 8;
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.AddMouseWheelEvent( wl_fixed_to_double( s_wheelAxisX * s_maxScale ), wl_fixed_to_double( s_wheelAxisY * s_maxScale ) );
|
||||
io.AddMouseWheelEvent( wl_fixed_to_double( s_wheelAxisX ), wl_fixed_to_double( s_wheelAxisY ) );
|
||||
s_wheelAxisX = s_wheelAxisY = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user