Skip to content

Commit 158048e

Browse files
committed
trying to make lists
1 parent 6d57f43 commit 158048e

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

shared-bindings/bitmaptools/__init__.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,8 @@ STATIC mp_obj_t bitmaptools_obj_paint_fill(size_t n_args, const mp_obj_t *pos_ar
336336
mp_raise_ValueError(translate("value out of range of target"));
337337
}
338338

339-
uint32_t background_value, color_depth;
339+
uint32_t background_value;
340340
background_value = args[ARG_background_value].u_int;
341-
color_depth = (1 << destination->bits_per_value);
342341
if (color_depth <= background_value) {
343342
mp_raise_ValueError(translate("background value out of range of target"));
344343
}

shared-module/bitmaptools/__init__.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,29 @@ void common_hal_bitmaptools_paint_fill(displayio_bitmap_t *destination,
256256
int16_t x, int16_t y,
257257
uint32_t value, uint32_t background_value) {
258258

259-
mp_printf(&mp_plat_print, "paint_fill");
259+
/*def _boundaryFill4(self, px, py, fc, bc): # px & py = x, y coord to start fill, fc = fill color, bc = background color
260+
fillArea = [[px, py]]
261+
262+
while len(fillArea) > 0:
263+
x, y = fillArea.pop()
264+
265+
if self._bitmap[x, y] != bc:
266+
continue
267+
self._bitmap[x, y] = fc
268+
fillArea.append((x + 1, y))
269+
fillArea.append((x - 1, y))
270+
fillArea.append((x, y + 1))
271+
fillArea.append((x, y - 1))*/
272+
mp_obj_list_t *fill_area;
273+
274+
//mp_obj_list_t *point;
275+
//mp_obj_list_append(point, x);
276+
//mp_obj_list_append(point, y);
277+
278+
mp_obj_list_append(MP_OBJ_FROM_PTR(*fill_area), MP_OBJ_NEW_QSTR(qstr_from_str("hello")));
279+
280+
//mp_printf(&mp_plat_print, fill_area[0]);
281+
//mp_obj_print(mp_obj_list_pop(fill_area, 0), PRINT_STR);
260282
}
261283

262284
void common_hal_bitmaptools_draw_line(displayio_bitmap_t *destination,

0 commit comments

Comments
 (0)