1 parent 5af59cb commit 6aa9709Copy full SHA for 6aa9709
1 file changed
shared-module/vectorio/Circle.c
@@ -28,7 +28,8 @@ uint32_t common_hal_vectorio_circle_get_pixel(void *obj, int16_t x, int16_t y) {
28
if (x+y <= radius) return 1;
29
if (x > radius) return 0;
30
if (y > radius) return 0;
31
- return (int32_t)x*x + (int32_t)y*y <= (int32_t)radius*radius;
+ const bool pythagorasSmallerThanRadius = (int32_t)x*x + (int32_t)y*y <= (int32_t)radius*radius;
32
+ return pythagorasSmallerThanRadius ? 1 : 0;
33
}
34
35
0 commit comments