From 1005eaaa6884aeb18087f93e068e93f8d663643f Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Sat, 30 Sep 2023 17:29:06 -0400 Subject: [PATCH] Document potentially negative mouse coordinates. --- api/syscalls.json | 2 +- ncc/examples/paint.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/syscalls.json b/api/syscalls.json index 01863dac..c7660759 100644 --- a/api/syscalls.json +++ b/api/syscalls.json @@ -290,7 +290,7 @@ ], "permission": "window_display", "const_idx": 11, - "description": "Register a callback for mouse movement." + "description": "Register a callback for mouse movement. Mouse x/y coordinates are relative to the top-left corner of the window and may be negative if outside of the window." }, { "name": "window_on_mousedown", diff --git a/ncc/examples/paint.c b/ncc/examples/paint.c index e10c69f0..6f809e5f 100644 --- a/ncc/examples/paint.c +++ b/ncc/examples/paint.c @@ -120,7 +120,7 @@ void draw_palette() } // Mouve movement callback -void mousemove(u64 window_id, u64 new_x, u64 new_y) +void mousemove(u64 window_id, int new_x, int new_y) { if (drawing) {