tuupola / hagl

Hardware Agnostic Graphics Library for embedded
https://www.appelsiini.net/tags/hagl/
MIT License
293 stars 47 forks source link

Fix circle rendering #106

Closed smarq8 closed 1 year ago

smarq8 commented 1 year ago

very first update 'd' assume 'x=0' and 'y=r' so we can not change them before updating 'd'. I know over internet we can found different versions so I manually checked it on a paper and it seems right.

tuupola commented 1 year ago

Excellent. I did not notice before that circles were slightly malformed. This can be quite clearly seen in the smaller radius circles. Attached rendering by original master and after your patch. Thanks!

circle-master circle-patch

tuupola commented 1 year ago

Seems filled circle needs some adjusting too. Image generated with:

hagl_draw_circle(backend, DISPLAY_WIDTH / 2, DISPLAY_WIDTH / 2, 300, red);
hagl_fill_circle(backend, DISPLAY_WIDTH / 2, DISPLAY_WIDTH / 2, 300, blue);

fill-circle