-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzoom_control.c
26 lines (24 loc) · 1.15 KB
/
zoom_control.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* zoom_control.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rblondia <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/01 18:07:15 by rblondia #+# #+# */
/* Updated: 2021/12/10 11:10:27 by rblondia ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../includes/fdf.h"
int zoom(int button, int x, int y, t_fdf *fdf)
{
(void) x;
(void) y;
if (button == MOUSE_SCROLL_UP)
fdf->camera->zoom++;
else if (button == MOUSE_SCROLL_DOWN)
fdf->camera->zoom--;
if (fdf->camera->zoom < 0)
fdf->camera->zoom = 1;
return (0);
}