-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscale.c
35 lines (32 loc) · 1.23 KB
/
scale.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* scale.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sadamant <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/01/25 14:30:14 by sadamant #+# #+# */
/* Updated: 2018/01/25 14:30:19 by sadamant ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void scale(t_session *env, int keycode)
{
int i;
int j;
double scaling;
j = 0;
scaling = (keycode == KEY_PLUS) ? TILECHANGE : 1/TILECHANGE;
while (env->points[j])
{
i = 0;
while (env->points[j][i])
{
env->points[j][i]->x *= scaling;
env->points[j][i]->y *= scaling;
env->points[j][i]->z *= scaling;
i++;
}
j++;
}
}