Skip to content

Commit 9697d19

Browse files
authored
Merge pull request #8823 from furbrain/fix_bitmaptools_bug
Make range check test against source bitmap, not destination
2 parents fe25858 + 9f01679 commit 9697d19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-bindings/bitmaptools/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,10 +1063,10 @@ STATIC mp_obj_t bitmaptools_obj_blit(size_t n_args, const mp_obj_t *pos_args, mp
10631063
uint16_t x = mp_arg_validate_int_range(args[ARG_x].u_int, 0, destination->width, MP_QSTR_x);
10641064
uint16_t y = mp_arg_validate_int_range(args[ARG_y].u_int, 0, destination->height, MP_QSTR_y);
10651065

1066-
bitmaptools_rect_t lim = bitmaptools_validate_coord_range_pair(&args[ARG_x1], destination->width, destination->height);
1067-
10681066
displayio_bitmap_t *source = mp_arg_validate_type(args[ARG_source].u_obj, &displayio_bitmap_type, MP_QSTR_source_bitmap);
10691067

1068+
bitmaptools_rect_t lim = bitmaptools_validate_coord_range_pair(&args[ARG_x1], source->width, source->height);
1069+
10701070

10711071
// ensure that the target bitmap (self) has at least as many `bits_per_value` as the source
10721072
if (destination->bits_per_value < source->bits_per_value) {

0 commit comments

Comments
 (0)