Tue, 05 Aug 2025 16:45:14 +0200
remove "bounds" creation argument for rectangles
we will keep the asc_rectangle_set_bounds() function, though
src/2d.c | file | annotate | diff | comparison | revisions | |
src/ascension/2d.h | file | annotate | diff | comparison | revisions |
--- a/src/2d.c Mon Aug 04 23:19:06 2025 +0200 +++ b/src/2d.c Tue Aug 05 16:45:14 2025 +0200 @@ -128,19 +128,10 @@ AscSceneNode *asc_rectangle_create(struct asc_rectangle_create_args args) { AscRectangle *rectangle = cxZallocDefault(sizeof(AscRectangle)); - float pos_x, pos_y; - if (args.bounds.size.width + args.bounds.size.height > 0) { - // TODO: this is probably bugged, because it does not respect the origin - pos_x = (float) args.bounds.pos.x; - pos_y = (float) args.bounds.pos.y; - rectangle->size.width = (float) args.bounds.size.width; - rectangle->size.height = (float) args.bounds.size.height; - } else { - pos_x = (float) args.x; - pos_y = (float) args.y; - rectangle->size.width = (float) args.width; - rectangle->size.height = (float) args.height; - } + float pos_x = (float) args.x; + float pos_y = (float) args.y; + rectangle->size.width = (float) args.width; + rectangle->size.height = (float) args.height; rectangle->radius = (float)args.radius; rectangle->filled = args.filled;