@@ -22,26 +22,26 @@ namespace pimoroni {
22
22
23
23
if (this ->graphics ->supports_alpha_blend () && pretty_poly::settings::antialias != pretty_poly::NONE) {
24
24
for (auto y = 0 ; y < tile.bounds .h ; y++) {
25
- for (auto x = 0 ; x < ( int ) tile.stride ; x++) {
25
+ for (auto x = 0 ; x < tile.bounds . w ; x++) {
26
26
uint8_t alpha = *tile_data++;
27
- if (x > tile.bounds .w ) continue ;
28
27
if (alpha >= 4 ) {
29
- this ->graphics ->pixel ({x + tile.bounds .x , y + tile.bounds .y });
28
+ this ->graphics ->set_pixel ({x + tile.bounds .x , y + tile.bounds .y });
30
29
} else if (alpha > 0 ) {
31
30
alpha = alpha_map[alpha];
32
31
this ->graphics ->set_pixel_alpha ({x + tile.bounds .x , y + tile.bounds .y }, alpha);
33
32
}
34
33
}
34
+ tile_data += tile.stride - tile.bounds .w ;
35
35
}
36
36
} else {
37
37
for (auto y = 0 ; y < tile.bounds .h ; y++) {
38
- for (auto x = 0 ; x < (int )tile.stride ; x++) {
39
- uint8_t alpha = *tile_data++;
40
- if (x > tile.bounds .w ) continue ;
38
+ for (auto x = 0 ; x < tile.bounds .w ; x++) {
39
+ uint8_t alpha = *tile_data++;
41
40
if (alpha) {
42
- this ->graphics ->pixel ({x + tile.bounds .x , y + tile.bounds .y });
41
+ this ->graphics ->set_pixel ({x + tile.bounds .x , y + tile.bounds .y });
43
42
}
44
43
}
44
+ tile_data += tile.stride - tile.bounds .w ;
45
45
}
46
46
}
47
47
}, graphics->supports_alpha_blend () ? pretty_poly::X4 : pretty_poly::NONE, {0 , 0 , graphics->bounds .w , graphics->bounds .h });
0 commit comments