Skip to content

Commit 2b7a7c0

Browse files
committed
floor the pixels
1 parent 0dea4c5 commit 2b7a7c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cdp/domains/input.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ fn dispatchMouseEvent(cmd: anytype) !void {
5757
const page = bc.session.currentPage() orelse return;
5858

5959
const mouse_event = Page.MouseEvent{
60-
.x = @intFromFloat(params.x), // Decimal pixel values are not understood by netsurf or out rendered
61-
.y = @intFromFloat(params.y), // So we convert them once at intake here
60+
.x = @intFromFloat(@floor(params.x)), // Decimal pixel values are not understood by netsurf or our rendered
61+
.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.
6262
.type = switch (params.type) {
6363
.mousePressed => .pressed,
6464
.mouseReleased => .released,

0 commit comments

Comments
 (0)