@@ -438,32 +438,36 @@ void displayio_group_finish_refresh(displayio_group_t *self) {
438
438
}
439
439
440
440
displayio_area_t * displayio_group_get_refresh_areas (displayio_group_t * self , displayio_area_t * tail ) {
441
- if (self -> item_removed ) {
442
- self -> dirty_area .next = tail ;
443
- tail = & self -> dirty_area ;
444
- }
445
-
446
- for (int32_t i = self -> members -> len - 1 ; i >= 0 ; i -- ) {
447
- mp_obj_t layer ;
448
- #if CIRCUITPY_VECTORIO
449
- const vectorio_draw_protocol_t * draw_protocol = mp_proto_get (MP_QSTR_protocol_draw , self -> members -> items [i ]);
450
- if (draw_protocol != NULL ) {
451
- layer = draw_protocol -> draw_get_protocol_self (self -> members -> items [i ]);
452
- tail = draw_protocol -> draw_protocol_impl -> draw_get_refresh_areas (layer , tail );
453
- continue ;
441
+ if (! self -> hidden ){
442
+ if (self -> item_removed ) {
443
+ self -> dirty_area .next = tail ;
444
+ tail = & self -> dirty_area ;
454
445
}
455
- #endif
456
- layer = mp_obj_cast_to_native_base (
457
- self -> members -> items [i ], & displayio_tilegrid_type );
458
- if (layer != MP_OBJ_NULL ) {
459
- tail = displayio_tilegrid_get_refresh_areas (layer , tail );
460
- continue ;
461
- }
462
- layer = mp_obj_cast_to_native_base (
463
- self -> members -> items [i ], & displayio_group_type );
464
- if (layer != MP_OBJ_NULL ) {
465
- tail = displayio_group_get_refresh_areas (layer , tail );
466
- continue ;
446
+
447
+ for (int32_t i = self -> members -> len - 1 ; i >= 0 ; i -- ) {
448
+ mp_obj_t layer ;
449
+ #if CIRCUITPY_VECTORIO
450
+ const vectorio_draw_protocol_t * draw_protocol = mp_proto_get (MP_QSTR_protocol_draw , self -> members -> items [i ]);
451
+ if (draw_protocol != NULL ) {
452
+ layer = draw_protocol -> draw_get_protocol_self (self -> members -> items [i ]);
453
+ tail = draw_protocol -> draw_protocol_impl -> draw_get_refresh_areas (layer , tail );
454
+ continue ;
455
+ }
456
+ #endif
457
+ layer = mp_obj_cast_to_native_base (
458
+ self -> members -> items [i ], & displayio_tilegrid_type );
459
+ if (layer != MP_OBJ_NULL ) {
460
+ if (!common_hal_displayio_tilegrid_get_hidden (layer )){
461
+ tail = displayio_tilegrid_get_refresh_areas (layer , tail );
462
+ }
463
+ continue ;
464
+ }
465
+ layer = mp_obj_cast_to_native_base (
466
+ self -> members -> items [i ], & displayio_group_type );
467
+ if (layer != MP_OBJ_NULL ) {
468
+ tail = displayio_group_get_refresh_areas (layer , tail );
469
+ continue ;
470
+ }
467
471
}
468
472
}
469
473
0 commit comments