Skip to content

Commit

Permalink
PicoVector: Avoid clipping bottom right AA edges.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBell authored and Gadgetoid committed Nov 26, 2024
1 parent 705465c commit 56b8c3e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions libraries/pico_vector/pretty-poly.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,14 @@ pp_rect_t render_nodes(pp_rect_t *tb) {
// either 1 (at x4) or 3 (at x16) we change that to a "ceil" instead ensuring
// the full tile bounds are returned
if(_pp_antialias) {
rb.w += (_pp_antialias | 0b1);
rb.h += (_pp_antialias | 0b1);
}
int maxx = rb.x + rb.w + (_pp_antialias | 0b1);
int maxy = rb.y + rb.h + (_pp_antialias | 0b1);

rb.x >>= _pp_antialias;
rb.y >>= _pp_antialias;
rb.w >>= _pp_antialias;
rb.h >>= _pp_antialias;
rb.x >>= _pp_antialias;
rb.y >>= _pp_antialias;
rb.w = (maxx >> _pp_antialias) - rb.x;
rb.h = (maxy >> _pp_antialias) - rb.y;
}

uint8_t *p_alpha_map = _pp_alpha_map_none;
if(_pp_antialias == 1) p_alpha_map = _pp_alpha_map_x4;
Expand Down

0 comments on commit 56b8c3e

Please sign in to comment.