-
Notifications
You must be signed in to change notification settings - Fork 0
/
fdf_middle.c
39 lines (36 loc) · 1.24 KB
/
fdf_middle.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fdf_middle.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jduval <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/23 10:20:26 by jduval #+# #+# */
/* Updated: 2023/01/26 13:12:41 by jduval ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void ft_middle_position(t_dot **map)
{
int x;
int y;
int i;
int j;
int tmp;
x = abs(map[0][0].cols / 2);
y = abs(map[0][0].lines / 2);
tmp = map[0][0].i - map[y][x].x1;
y = map[0][0].j - map[y][x].y1;
i = 0;
while (i < map[0][0].lines)
{
j = 0;
while (j < map[0][0].cols)
{
map[i][j].x1 += tmp;
map[i][j].y1 += y;
j++;
}
i++;
}
}