Add feels-good scaling factor to wheel scroll values.

This commit is contained in:
Bartosz Taudul 2024-09-19 21:02:58 +02:00
parent 4795011b12
commit e793f927fc
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -200,7 +200,7 @@ Backend::Backend( const char* title, const std::function<void()>& redraw, const
return EM_TRUE; return EM_TRUE;
} ); } );
emscripten_set_wheel_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenWheelEvent* e, void* ) -> EM_BOOL { emscripten_set_wheel_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenWheelEvent* e, void* ) -> EM_BOOL {
ImGui::GetIO().AddMouseWheelEvent( -e->deltaX, -e->deltaY ); ImGui::GetIO().AddMouseWheelEvent( e->deltaX * -0.05, e->deltaY * -0.05 );
tracy::s_wasActive = true; tracy::s_wasActive = true;
return EM_TRUE; return EM_TRUE;
} ); } );