Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,12 @@ void wheel(SDL_MouseWheelEvent event) {
boolean flipped = event.direction() == SDLMouse.SDL_MOUSEWHEEL_FLIPPED;
int sign = flipped ? -1 : 1;
float amount = event.y() * sign;
this.legacy.wheel(this.pixelX(event.mouse_x()), this.pixelY(event.mouse_y()), amount, event.timestamp());
// High-resolution wheels report one notch as several fractional events, but LWJGL 2 consumers treat every
// wheel event as a single step, so the legacy queue only receives whole notches
int notches = event.integer_y() * sign;
if (notches != 0) {
this.legacy.wheel(this.pixelX(event.mouse_x()), this.pixelY(event.mouse_y()), notches, event.timestamp());
}
SDL.events()
.post(new MouseEvent.Wheel(event.which(), this.id, event.timestamp(), event.mouse_x(), event.mouse_y(),
event.x() * sign, amount, event.integer_x() * sign, event.integer_y() * sign, flipped
Expand Down