InputManager: Fix wheel scrolling in Big Picture
This commit is contained in:
parent
bda6869084
commit
f0deab2131
|
@ -926,7 +926,7 @@ bool ImGuiManager::ProcessPointerButtonEvent(InputBindingKey key, float value)
|
||||||
|
|
||||||
bool ImGuiManager::ProcessPointerAxisEvent(InputBindingKey key, float value)
|
bool ImGuiManager::ProcessPointerAxisEvent(InputBindingKey key, float value)
|
||||||
{
|
{
|
||||||
if (!ImGui::GetCurrentContext() || value == 0.0f || key.data < static_cast<u32>(InputPointerAxis::WheelX))
|
if (!ImGui::GetCurrentContext() || key.data < static_cast<u32>(InputPointerAxis::WheelX))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// still update state anyway
|
// still update state anyway
|
||||||
|
|
|
@ -1187,6 +1187,9 @@ void InputManager::GenerateRelativeMouseEvents()
|
||||||
{
|
{
|
||||||
PointerAxisState& state = s_pointer_state[device][axis];
|
PointerAxisState& state = s_pointer_state[device][axis];
|
||||||
const float delta = static_cast<float>(state.delta.exchange(0, std::memory_order_acquire)) / 65536.0f;
|
const float delta = static_cast<float>(state.delta.exchange(0, std::memory_order_acquire)) / 65536.0f;
|
||||||
|
if (delta == 0.0f)
|
||||||
|
continue;
|
||||||
|
|
||||||
const float unclamped_value = delta * s_pointer_axis_scale[axis];
|
const float unclamped_value = delta * s_pointer_axis_scale[axis];
|
||||||
|
|
||||||
const InputBindingKey key(MakePointerAxisKey(device, static_cast<InputPointerAxis>(axis)));
|
const InputBindingKey key(MakePointerAxisKey(device, static_cast<InputPointerAxis>(axis)));
|
||||||
|
@ -1276,7 +1279,7 @@ void InputManager::UpdatePointerAbsolutePosition(u32 index, float x, float y)
|
||||||
|
|
||||||
void InputManager::UpdatePointerRelativeDelta(u32 index, InputPointerAxis axis, float d, bool raw_input)
|
void InputManager::UpdatePointerRelativeDelta(u32 index, InputPointerAxis axis, float d, bool raw_input)
|
||||||
{
|
{
|
||||||
if (index >= MAX_POINTER_DEVICES || !s_relative_mouse_mode_active)
|
if (index >= MAX_POINTER_DEVICES || (axis < InputPointerAxis::WheelX && !s_relative_mouse_mode_active))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s_host_pointer_positions[index][static_cast<u8>(axis)] += d;
|
s_host_pointer_positions[index][static_cast<u8>(axis)] += d;
|
||||||
|
|
Loading…
Reference in New Issue