overdev / raylib-py

A Python binding for the great C library raylib.
Other
199 stars 18 forks source link

fix draw_line_ex function #20

Closed mmoghaddam385 closed 1 year ago

mmoghaddam385 commented 3 years ago

It looks like there was a typo in the draw_line_ex function that made it unusable. It tried to coerce the thick parameter (a float) into a vec2, then back into a float, which always fails and throws an exception.

In the meantime, I've been redefining the function as the following lambda without the problematic cast

import raylibpy as rl
rl.draw_line_ex = lambda start_pos, end_pos, thick, color: rl._rl.DrawLineEx(rl._vec2(start_pos), rl._vec2(end_pos), rl._float(thick), rl._color(color))