File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change 32
32
33
33
#if CIRCUITPY_VECTORIO
34
34
#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"
38
35
#endif
39
36
40
37
@@ -104,22 +101,10 @@ void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden)
104
101
continue ;
105
102
}
106
103
#if CIRCUITPY_VECTORIO
107
- layer = mp_obj_cast_to_native_base (
108
- self -> members -> items [i ], & vectorio_circle_type );
109
- if (layer != MP_OBJ_NULL ) {
110
- common_hal_vectorio_vector_shape_set_dirty (common_hal_vectorio_circle_get_draw_protocol (layer ));
111
- continue ;
112
- }
113
- layer = mp_obj_cast_to_native_base (
114
- self -> members -> items [i ], & vectorio_rectangle_type );
115
- if (layer != MP_OBJ_NULL ) {
116
- common_hal_vectorio_vector_shape_set_dirty (common_hal_vectorio_rectangle_get_draw_protocol (layer ));
117
- continue ;
118
- }
119
- layer = mp_obj_cast_to_native_base (
120
- self -> members -> items [i ], & vectorio_polygon_type );
121
- if (layer != MP_OBJ_NULL ) {
122
- common_hal_vectorio_vector_shape_set_dirty (common_hal_vectorio_polygon_get_draw_protocol (layer ));
104
+ const vectorio_draw_protocol_t * draw_protocol = mp_proto_get (MP_QSTR_protocol_draw , self -> members -> items [i ]);
105
+ if (draw_protocol != NULL ) {
106
+ layer = draw_protocol -> draw_get_protocol_self (self -> members -> items [i ]);
107
+ draw_protocol -> draw_protocol_impl -> draw_set_dirty (layer );
123
108
continue ;
124
109
}
125
110
#endif
You can’t perform that action at this time.
0 commit comments