/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/27 14:29:26 by ljiriste #+# #+# */
-/* Updated: 2024/04/10 14:03:23 by ljiriste ### ########.fr */
+/* Updated: 2024/04/18 09:54:31 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
int y_pix_change;
x_pix_change = round(move_amount_right * s->img.height);
+ if (x_pix_change == 0)
+ x_pix_change = (move_amount_right > 0) - (move_amount_right < 0);
y_pix_change = -round(move_amount_up * s->img.height);
+ if (y_pix_change == 0)
+ y_pix_change = -((move_amount_up > 0) - (move_amount_up < 0));
s->view.window_coord.x += x_pix_change * s->view.pixel_size.x;
s->view.window_coord.y -= y_pix_change * s->view.pixel_size.y;
move_img(&s->img, x_pix_change, y_pix_change);
s->img.width = 1000;
s->img.height = 1000;
s->img.undersample_max = 5;
- init_view(s);
return ;
}
return (1);
++i;
}
+ init_view(s);
return (0);
}