diff options
Diffstat (limited to 'src/main.c')
| -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(); |
