summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-03-01 15:18:32 -0600
committerJeff Epler <jepler@gmail.com>2021-03-01 15:18:32 -0600
commit238484ec261af55b90a39a8dcfc9fcdd6cb4390c (patch)
tree27811c903f8976b707ee325693521a877ca5661e /shared-module
parent407a8c222a03166a03b8209f752e2a016e977d08 (diff)
parent532e7db293a041fb695ce2455ffdb6ac3a3bbf2d (diff)
Merge remote-tracking branch 'origin/main' into update-protomatter-rp2
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/displayio/Bitmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c
index cf34f2d35..c9ea83428 100644
--- a/shared-module/displayio/Bitmap.c
+++ b/shared-module/displayio/Bitmap.c
@@ -130,14 +130,14 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16
// simplest version - use internal functions for get/set pixels
for (int16_t i=0; i < (x2-x1); i++) {
- const int xs_index = x_reverse ? ( (x2 - 1) - i ) : x1+i; // x-index into the source bitmap
- const int xd_index = x_reverse ? ((x + (x2-x1)) - i ) : x+i; // x-index into the destination bitmap
+ const int xs_index = x_reverse ? ( (x2) - i - 1) : x1+i; // x-index into the source bitmap
+ const int xd_index = x_reverse ? ((x + (x2-x1)) - i - 1) : x+i; // x-index into the destination bitmap
if ( (xd_index >= 0) && (xd_index < self->width) ) {
for (int16_t j=0; j < (y2-y1) ; j++){
- const int ys_index = y_reverse ? ( (y2 - 1) - j ) : y1+j ; // y-index into the source bitmap
- const int yd_index = y_reverse ? ((y + (y2-y1)) - j ) : y+j ; // y-index into the destination bitmap
+ const int ys_index = y_reverse ? ( (y2 ) - j - 1) : y1+j ; // y-index into the source bitmap
+ const int yd_index = y_reverse ? ((y + (y2-y1)) - j - 1) : y+j ; // y-index into the destination bitmap
if ((yd_index >= 0) && (yd_index < self->height) ) {
uint32_t value = common_hal_displayio_bitmap_get_pixel(source, xs_index, ys_index);