diff --git a/lib/graphics.c b/lib/graphics.c index 3e16be9..304d145 100644 --- a/lib/graphics.c +++ b/lib/graphics.c @@ -947,10 +947,10 @@ void draw_rounded_rectangle(gfx_context_t * ctx, int32_t x, int32_t y, uint16_t } GFX(ctx, _x, _y) = alpha_blend_rgba(GFX(ctx, _x, _y), c); - GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), c); + if (_z >= 0) GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), c); _x = x + radius - i - 1; GFX(ctx, _x, _y) = alpha_blend_rgba(GFX(ctx, _x, _y), c); - GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), c); + if (_z >= 0) GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), c); } } } @@ -990,10 +990,10 @@ void draw_rounded_rectangle_pattern(gfx_context_t * ctx, int32_t x, int32_t y, u double alpha = (j_max - (double)j); GFX(ctx, _x, _y) = alpha_blend_rgba(GFX(ctx, _x, _y), pattern(_x,_y,alpha,extra)); - GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), pattern(_x,_z,alpha,extra)); + if (_z >= 0) GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), pattern(_x,_z,alpha,extra)); _x = x + radius - i - 1; GFX(ctx, _x, _y) = alpha_blend_rgba(GFX(ctx, _x, _y), pattern(_x,_y,alpha,extra)); - GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), pattern(_x,_z,alpha,extra)); + if (_z >= 0) GFX(ctx, _x, _z) = alpha_blend_rgba(GFX(ctx, _x, _z), pattern(_x,_z,alpha,extra)); } } }