summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/main.c b/src/main.c
index cc9c25e..271ce40 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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();