diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-10-11 11:58:31 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-10-11 11:58:31 +0700 |
commit | 2e6dfc9d7200b929391d7cb6d00e2f262c6abb0c (patch) | |
tree | 9927ec9d0dbd2e78096f177dc4f62972d8fb9a43 | |
parent | 348d34a90cf433b3a8b7600327955db8022606c4 (diff) |
fix mouse event
-rw-r--r-- | sources/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/main.c b/sources/main.c index 6393a84..aa5cc95 100644 --- a/sources/main.c +++ b/sources/main.c @@ -47,8 +47,10 @@ int main(void) int nearestI = GetMouseX() / space; int nearestJ = GetMouseY() / space; - if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currState[nearestI][nearestJ] = true; - if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) currState[nearestI][nearestJ] = false; + if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) + currState[nearestI][nearestJ] = true; + if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) + currState[nearestI][nearestJ] = false; for (int i=0; i<dim; i++) { for (int j=0; j<dim; j++) { |