summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2024-08-11 21:05:19 +0200
committerLouis Burda <quent.burda@gmail.com>2024-08-11 21:05:19 +0200
commit1696179a664286697fb010e58283cacf8d3b3866 (patch)
tree084af092c934d1f78dba260693cfc845268c62ba
parent79e3974d34994261fd2239575fd6661bcce28b0e (diff)
downloadxnote-1696179a664286697fb010e58283cacf8d3b3866.tar.gz
xnote-1696179a664286697fb010e58283cacf8d3b3866.zip
Add new note after mouse move
-rw-r--r--xnote.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xnote.c b/xnote.c
index 470fed3..0d7f546 100644
--- a/xnote.c
+++ b/xnote.c
@@ -30,6 +30,7 @@ enum event {
EVENT_START_LINE,
EVENT_END_LINE,
EVENT_START_NOTE,
+ EVENT_MOUSE_MOVE,
};
static struct line *lines = NULL;
@@ -173,6 +174,8 @@ mouse_move_cb(GLFWwindow *window, double x, double y)
&line->count, &line->cap, sizeof(struct point));
point->x = cursor_x;
point->y = cursor_y;
+ } else if (last_event() != EVENT_MOUSE_MOVE) {
+ push_event(EVENT_MOUSE_MOVE);
}
}