mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
floor the pixels
This commit is contained in:
@@ -57,8 +57,8 @@ fn dispatchMouseEvent(cmd: anytype) !void {
|
||||
const page = bc.session.currentPage() orelse return;
|
||||
|
||||
const mouse_event = Page.MouseEvent{
|
||||
.x = @intFromFloat(params.x), // Decimal pixel values are not understood by netsurf or out rendered
|
||||
.y = @intFromFloat(params.y), // So we convert them once at intake here
|
||||
.x = @intFromFloat(@floor(params.x)), // Decimal pixel values are not understood by netsurf or our rendered
|
||||
.y = @intFromFloat(@floor(params.y)), // So we convert them once at intake here. Using floor such that -0.5 becomes -1 and 0.5 becomes 0.
|
||||
.type = switch (params.type) {
|
||||
.mousePressed => .pressed,
|
||||
.mouseReleased => .released,
|
||||
|
||||
Reference in New Issue
Block a user