trying to make vectorio shape hidable

This commit is contained in:
foamyguy 2022-04-09 10:09:46 -05:00
parent d9418fb7a3
commit 666a5ff04c

View File

@ -358,35 +358,45 @@ void displayio_group_construct(displayio_group_t *self, mp_obj_list_t *members,
bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer) {
// Track if any of the layers finishes filling in the given area. We can ignore any remaining // Track if any of the layers finishes filling in the given area. We can ignore any remaining
// layers at that point. // layers at that point.
for (int32_t i = self->members->len - 1; i >= 0; i--) { //mp_printf(&mp_plat_print, "inside fill area \n");
mp_obj_t layer; //mp_printf(&mp_plat_print, "%d \n", self->hidden);
#if CIRCUITPY_VECTORIO //mp_printf(&mp_plat_print, "\n");
const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]);
if (draw_protocol != NULL) { //mp_printf(&mp_plat_print, "inside fill area \n");
layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); if (self->hidden == false){
if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) { //mp_printf(&mp_plat_print, "not hidden\n");
return true; for (int32_t i = self->members->len - 1; i >= 0; i--) {
mp_obj_t layer;
#if CIRCUITPY_VECTORIO
const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]);
if (draw_protocol != NULL) {
layer = draw_protocol->draw_get_protocol_self(self->members->items[i]);
if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) {
return true;
}
continue;
} }
continue; #endif
} layer = mp_obj_cast_to_native_base(
#endif self->members->items[i], &displayio_tilegrid_type);
layer = mp_obj_cast_to_native_base( if (layer != MP_OBJ_NULL) {
self->members->items[i], &displayio_tilegrid_type); if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) {
if (layer != MP_OBJ_NULL) { return true;
if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { }
return true; continue;
} }
continue; layer = mp_obj_cast_to_native_base(
} self->members->items[i], &displayio_group_type);
layer = mp_obj_cast_to_native_base( if (layer != MP_OBJ_NULL) {
self->members->items[i], &displayio_group_type); if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) {
if (layer != MP_OBJ_NULL) { return true;
if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { }
return true; continue;
} }
continue;
} }
} }
return false; return false;
} }