kopia lustrzana https://github.com/pimoroni/pimoroni-pico
PicoVector: Fix out of bounds drawing.
pretty-poly.h is not giving us fully clipped rectangles, so revert to the slower bounds checked pixel for now.pull/1019/head
rodzic
56d430b862
commit
e48c798bdb
|
@ -63,11 +63,12 @@ namespace pimoroni {
|
||||||
(uint8_t)_pp_antialias)) {
|
(uint8_t)_pp_antialias)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto y = 0; y < tile->h; y++) {
|
for(auto y = 0; y < tile->h; y++) {
|
||||||
for(auto x = 0; x < tile->w; x++) {
|
for(auto x = 0; x < tile->w; x++) {
|
||||||
uint8_t alpha = *tile_data++;
|
uint8_t alpha = *tile_data++;
|
||||||
if (alpha >= 4) {
|
if (alpha >= 4) {
|
||||||
PicoVector::graphics->set_pixel({x + tile->x, y + tile->y});
|
PicoVector::graphics->pixel({x + tile->x, y + tile->y});
|
||||||
} else if (alpha > 0) {
|
} else if (alpha > 0) {
|
||||||
alpha = alpha_map[alpha];
|
alpha = alpha_map[alpha];
|
||||||
PicoVector::graphics->set_pixel_alpha({x + tile->x, y + tile->y}, alpha);
|
PicoVector::graphics->set_pixel_alpha({x + tile->x, y + tile->y}, alpha);
|
||||||
|
@ -80,7 +81,7 @@ namespace pimoroni {
|
||||||
for(auto x = 0; x < tile->w; x++) {
|
for(auto x = 0; x < tile->w; x++) {
|
||||||
uint8_t alpha = *tile_data++;
|
uint8_t alpha = *tile_data++;
|
||||||
if (alpha) {
|
if (alpha) {
|
||||||
PicoVector::graphics->set_pixel({x + tile->x, y + tile->y});
|
PicoVector::graphics->pixel({x + tile->x, y + tile->y});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tile_data += tile->stride - tile->w;
|
tile_data += tile->stride - tile->w;
|
||||||
|
|
Ładowanie…
Reference in New Issue