Skip to content

Commit 38fb7b5

Browse files
committed
Remove max_size from displayio.Group
Still accept it as an argument. Add deprecation note.
1 parent 9c41753 commit 38fb7b5

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

shared-bindings/displayio/Group.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
//| """Create a Group of a given size and scale. Scale is in one dimension. For example, scale=2
4343
//| leads to a layer's pixel being 2x2 pixels when in the group.
4444
//|
45-
//| :param int max_size: The maximum group size.
45+
//| :param int max_size: Ignored. Will be removed in 7.x.
4646
//| :param int scale: Scale of layer pixels in one dimension.
4747
//| :param int x: Initial x position within the parent.
4848
//| :param int y: Initial y position within the parent."""
@@ -59,19 +59,14 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg
5959
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
6060
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
6161

62-
mp_int_t max_size = args[ARG_max_size].u_int;
63-
if (max_size < 1) {
64-
mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_max_size);
65-
}
66-
6762
mp_int_t scale = args[ARG_scale].u_int;
6863
if (scale < 1) {
6964
mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_scale);
7065
}
7166

7267
displayio_group_t *self = m_new_obj(displayio_group_t);
7368
self->base.type = &displayio_group_type;
74-
common_hal_displayio_group_construct(self, max_size, scale, args[ARG_x].u_int, args[ARG_y].u_int);
69+
common_hal_displayio_group_construct(self, scale, args[ARG_x].u_int, args[ARG_y].u_int);
7570

7671
return MP_OBJ_FROM_PTR(self);
7772
}

shared-bindings/displayio/Group.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern const mp_obj_type_t displayio_group_type;
3333

3434
displayio_group_t* native_group(mp_obj_t group_obj);
3535

36-
void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y);
36+
void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t scale, mp_int_t x, mp_int_t y);
3737
uint32_t common_hal_displayio_group_get_scale(displayio_group_t* self);
3838
void common_hal_displayio_group_set_scale(displayio_group_t* self, uint32_t scale);
3939
bool common_hal_displayio_group_get_hidden(displayio_group_t* self);

shared-module/displayio/Group.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#endif
3636

3737

38-
void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y) {
38+
void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t scale, mp_int_t x, mp_int_t y) {
3939
mp_obj_list_t *members = mp_obj_new_list(0, NULL);
4040
displayio_group_construct(self, members, scale, x, y);
4141
}

0 commit comments

Comments
 (0)