mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13: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 page = bc.session.currentPage() orelse return;
|
||||||
|
|
||||||
const mouse_event = Page.MouseEvent{
|
const mouse_event = Page.MouseEvent{
|
||||||
.x = @intFromFloat(params.x), // Decimal pixel values are not understood by netsurf or out rendered
|
.x = @intFromFloat(@floor(params.x)), // Decimal pixel values are not understood by netsurf or our rendered
|
||||||
.y = @intFromFloat(params.y), // So we convert them once at intake here
|
.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) {
|
.type = switch (params.type) {
|
||||||
.mousePressed => .pressed,
|
.mousePressed => .pressed,
|
||||||
.mouseReleased => .released,
|
.mouseReleased => .released,
|
||||||
|
|||||||
Reference in New Issue
Block a user