aboutsummaryrefslogtreecommitdiff
path: root/src/fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fb.c')
-rw-r--r--src/fb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fb.c b/src/fb.c
index 6a82fde..f52f0c0 100644
--- a/src/fb.c
+++ b/src/fb.c
@@ -64,6 +64,10 @@ bool pw_fb_iterate(struct pw_framebuffer *fb) {
static uint8_t project_component(float r, float start, float size,
uint8_t dim) {
+ if (SDL_fabsf(size) < 1.) {
+ return 0;
+ }
+
float dimf = (float)dim;
float df = SDL_floorf(((r - start) * dimf) / size);
return (uint8_t)SDL_clamp(df, 0.0, (float)(dim - 1));