-
Notifications
You must be signed in to change notification settings - Fork 0
/
flatten.c
39 lines (33 loc) · 1.29 KB
/
flatten.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
27
28
29
30
31
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* flatten.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dvan-der <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/15 08:23:49 by dvan-der #+# #+# */
/* Updated: 2021/12/16 15:41:44 by dvan-der ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
static void increase_zoom(t_fdf *fdf, double x, int y);
void flatten(int key, void *param)
{
t_fdf *fdf;
fdf = (t_fdf *)param;
if (key == 27)
increase_zoom(fdf, -0.1, 1);
else
increase_zoom(fdf, 0.1, 1);
}
static void increase_zoom(t_fdf *fdf, double x, int y)
{
t_camera *camera;
camera = fdf->camera;
if (y == 0)
camera->zoom += x;
else
camera->size_z += x;
make_black(fdf);
letsdraw(fdf);
}