fix mouse wheel zooming map when hovering imgui windows
This commit is contained in:
parent
7e1894984c
commit
2af0361ac5
@ -1682,6 +1682,9 @@ static void process_event_editor(SDL_Event event) {
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case SDL_EVENT_MOUSE_WHEEL: {
|
case SDL_EVENT_MOUSE_WHEEL: {
|
||||||
|
if (io.WantCaptureMouse)
|
||||||
|
return;
|
||||||
|
|
||||||
vec2 floor_pos_before = get_floor_intersection_of_mouse(vec2(event.wheel.mouse_x, event.wheel.mouse_y));
|
vec2 floor_pos_before = get_floor_intersection_of_mouse(vec2(event.wheel.mouse_x, event.wheel.mouse_y));
|
||||||
editor_camera_distance = SDL_max(0.2, editor_camera_distance - event.wheel.y * SDL_sqrt(editor_camera_distance));
|
editor_camera_distance = SDL_max(0.2, editor_camera_distance - event.wheel.y * SDL_sqrt(editor_camera_distance));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user