Fixed Divide by zero

Saw this floating around.
This commit is contained in:
Kwabena W. Agyeman 2018-03-18 22:10:57 -04:00
parent d7159fba3e
commit 3342f68ca2

View File

@ -1140,8 +1140,8 @@ STATIC mp_obj_t py_image_draw_arrow(uint n_args, const mp_obj_t *args, mp_map_t
int dy = (arg_y1 - arg_y0);
float length = fast_sqrtf((dx * dx) + (dy * dy));
float ux = dx / length;
float uy = dy / length;
float ux = IM_DIV(dx, length);
float uy = IM_DIV(dy, length);
float vx = -uy;
float vy = ux;