@@ -184,7 +184,8 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val
184
184
//| : param int y1: Minimum y-value for rectangular bounding box to be copied from the source bitmap
185
185
//| : param int x2: Maximum x-value for rectangular bounding box to be copied from the source bitmap
186
186
//| : param int y2: Maximum y-value for rectangular bounding box to be copied from the source bitmap
187
- //| : param int skip_index: bitmap palette index in the source that will not be copied, set `None` to copy all pixels
187
+ //| : param int skip_index: bitmap palette index in the source that will not be copied,
188
+ //| set `None` to copy all pixels"""
188
189
//| ...
189
190
//|
190
191
@@ -229,19 +230,17 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg
229
230
y2 = mp_obj_get_int (args [ARG_y2 ].u_obj );
230
231
}
231
232
232
-
233
233
// Check x,y are within self (target) bitmap boundary
234
234
if ( (x < 0 ) || (y < 0 ) || (x > self -> width ) || (y > self -> height ) ) {
235
235
mp_raise_ValueError (translate ("(x,y): out of range of target bitmap" ));
236
236
}
237
237
// Check x1,y1,x2,y2 are within source bitmap boundary
238
- if ( (x1 < 0 ) || (x1 > source -> width ) ||
239
- (y1 < 0 ) || (y1 > source -> height ) ||
238
+ if ( (x1 < 0 ) || (x1 > source -> width ) ||
239
+ (y1 < 0 ) || (y1 > source -> height ) ||
240
240
(x2 < 0 ) || (x2 > source -> width ) ||
241
241
(y2 < 0 ) || (y2 > source -> height ) ) {
242
242
mp_raise_ValueError (translate ("(x1,y1) or (x2,y2): out of range of source bitmap" ));
243
243
}
244
-
245
244
// Ensure x1 < x2 and y1 < y2
246
245
if (x1 > x2 ) {
247
246
int16_t temp = x2 ;
@@ -254,7 +253,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg
254
253
y1 = temp ;
255
254
}
256
255
257
- uint32_t skip_index ;
256
+ uint32_t skip_index ;
258
257
bool skip_index_none ; // flag whether skip_value was None
259
258
260
259
if (args [ARG_skip_index ].u_obj == mp_const_none ) {
@@ -263,7 +262,7 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg
263
262
} else {
264
263
skip_index = mp_obj_get_int (args [ARG_skip_index ].u_obj );
265
264
skip_index_none = false;
266
- }
265
+ }
267
266
268
267
common_hal_displayio_bitmap_blit (self , x , y , source , x1 , y1 , x2 , y2 , skip_index , skip_index_none );
269
268
0 commit comments