summaryrefslogtreecommitdiff
path: root/shared-bindings/vectorio/Polygon.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared-bindings/vectorio/Polygon.c')
-rw-r--r--shared-bindings/vectorio/Polygon.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c
index 3443d9e42..6a72f9124 100644
--- a/shared-bindings/vectorio/Polygon.c
+++ b/shared-bindings/vectorio/Polygon.c
@@ -15,10 +15,8 @@
// #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__)
-//| from typing import List, Tuple
-//|
//| class Polygon:
-//| def __init__(self, points: List[ Tuple[ x, y ], ... ] ):
+//| def __init__(self, points: List[Tuple[int, int]]) -> None:
//| """Represents a closed shape by ordered vertices
//|
//| :param points: Vertices for the polygon"""
@@ -44,25 +42,12 @@ static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_ar
}
-//| points: List[ Tuple[ x, y ], ... ] = ...
+//| points: List[Tuple[int, int]]
//| """Set a new look and shape for this polygon"""
//|
STATIC mp_obj_t vectorio_polygon_obj_get_points(mp_obj_t self_in) {
vectorio_polygon_t *self = MP_OBJ_TO_PTR(self_in);
- mp_obj_t list = mp_obj_new_list(0, NULL);
-
- size_t len = 0;
- mp_obj_t *items;
- mp_obj_list_get(common_hal_vectorio_polygon_get_points(self), &len, &items);
-
- for (size_t i = 0; i < len; i += 2) {
- mp_obj_t tuple[] = { items[i], items[i+1] };
- mp_obj_list_append(
- list,
- mp_obj_new_tuple(2, tuple)
- );
- }
- return list;
+ return common_hal_vectorio_polygon_get_points(self);
}
MP_DEFINE_CONST_FUN_OBJ_1(vectorio_polygon_get_points_obj, vectorio_polygon_obj_get_points);