diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -42,19 +42,22 @@ int main() { camera.zoom = 4.0f; while (!WindowShouldClose()) { - if (GetMouseWheelMove() != 0.0) { - camera.zoom += (int)GetMouseWheelMove(); - - if (camera.zoom > 6.0f) - camera.zoom = 6.0f; - else if (camera.zoom < 4.0f) - camera.zoom = 4.0f; - } - - if (IsMouseButtonDown(MOUSE_BUTTON_MIDDLE)) { - Vector2 mousePos = GetMouseDelta(); - camera.target.x -= mousePos.x / 5.0f; - camera.target.y -= mousePos.y / 5.0f; + // interact with the map if the mouse is outside build tab + if (GetMousePosition().x < EDITOR_TOOLKIT_X) { + if (GetMouseWheelMove() != 0.0) { + camera.zoom += (int)GetMouseWheelMove(); + + if (camera.zoom > 6.0f) + camera.zoom = 6.0f; + else if (camera.zoom < 4.0f) + camera.zoom = 4.0f; + } + + if (IsMouseButtonDown(MOUSE_BUTTON_MIDDLE)) { + Vector2 mousePos = GetMouseDelta(); + camera.target.x -= mousePos.x / 5.0f; + camera.target.y -= mousePos.y / 5.0f; + } } BeginDrawing(); |
