core: mouse reports should always send on release even if outside

Fixes #481
This commit is contained in:
Mitchell Hashimoto
2023-09-17 14:22:24 -07:00
parent 37cf0b2321
commit ef7e0f7fdb

View File

@ -1305,8 +1305,9 @@ fn mouseReport(
.any => {},
}
// The maximum pos values so we can determine if we're outside the window.
// If we're outside the window, we do not report mouse events.
// Handle scenarios where the mouse position is outside the viewport.
// We always report release events no matter where they happen.
if (action != .release) {
const pos_out_viewport = pos_out_viewport: {
const max_x: f32 = @floatFromInt(self.screen_size.width);
const max_y: f32 = @floatFromInt(self.screen_size.height);
@ -1325,6 +1326,7 @@ fn mouseReport(
return;
}
}
// This format reports X/Y
const viewport_point = self.posToViewport(pos.x, pos.y);