diff options
| author | ilotterytea <iltsu@alright.party> | 2025-01-31 02:54:55 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-01-31 02:54:55 +0500 |
| commit | 48923d6ae620939b8d5aae71175c424c5ac57613 (patch) | |
| tree | ee1cc44601169b991e1afda319bb83f214ee05bb | |
| parent | ea1c0a112de752ef9dea2d9bfabcbf5ea3254be7 (diff) | |
upd: ignore clicks behind editor and when user is creating block
| -rw-r--r-- | src/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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(); |
