Skip to content

Commit b03968a

Browse files
committed
hide vectorio objects if their containing group is hidden
1 parent c8a98d1 commit b03968a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

shared-module/displayio/Group.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
#if CIRCUITPY_VECTORIO
3434
#include "shared-bindings/vectorio/VectorShape.h"
35+
#include "shared-bindings/vectorio/Circle.h"
36+
#include "shared-bindings/vectorio/Rectangle.h"
37+
#include "shared-bindings/vectorio/Polygon.h"
3538
#endif
3639

3740

@@ -66,6 +69,26 @@ void common_hal_displayio_group_set_hidden(displayio_group_t *self, bool hidden)
6669
displayio_group_set_hidden_by_parent(layer, hidden);
6770
continue;
6871
}
72+
#if CIRCUITPY_VECTORIO
73+
layer = mp_obj_cast_to_native_base(
74+
self->members->items[i], &vectorio_circle_type);
75+
if (layer != MP_OBJ_NULL) {
76+
common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_circle_get_draw_protocol(layer));
77+
continue;
78+
}
79+
layer = mp_obj_cast_to_native_base(
80+
self->members->items[i], &vectorio_rectangle_type);
81+
if (layer != MP_OBJ_NULL) {
82+
common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_rectangle_get_draw_protocol(layer));
83+
continue;
84+
}
85+
layer = mp_obj_cast_to_native_base(
86+
self->members->items[i], &vectorio_polygon_type);
87+
if (layer != MP_OBJ_NULL) {
88+
common_hal_vectorio_vector_shape_set_dirty(common_hal_vectorio_polygon_get_draw_protocol(layer));
89+
continue;
90+
}
91+
#endif
6992
}
7093
}
7194

0 commit comments

Comments
 (0)