summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-01-31 02:54:55 +0500
committerilotterytea <iltsu@alright.party>2025-01-31 02:54:55 +0500
commit48923d6ae620939b8d5aae71175c424c5ac57613 (patch)
treeee1cc44601169b991e1afda319bb83f214ee05bb /src/main.c
parentea1c0a112de752ef9dea2d9bfabcbf5ea3254be7 (diff)
upd: ignore clicks behind editor and when user is creating block
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 6c0e533..88a8b18 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,10 +30,16 @@ int main() {
while (!WindowShouldClose()) {
SE_UpdateEditor(&editor);
- SE_UpdateTileFloor(&editor.state, floor, &camera);
- // interact with the map if the mouse is outside build tab
- if (GetMousePosition().x < EDITOR_TOOLKIT_X) {
+ bool isEditorFocused =
+ CheckCollisionPointRec(
+ GetMousePosition(),
+ (Rectangle){0.0f, 0.0f, EDITOR_TOOLKIT_X, GetScreenHeight()}) &&
+ editor.state.createBlockState == NULL;
+
+ if (isEditorFocused) {
+ SE_UpdateTileFloor(&editor.state, floor, &camera);
+
if (GetMouseWheelMove() != 0.0) {
camera.zoom += (int)GetMouseWheelMove();