summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();