remove "bounds" creation argument for rectangles

Tue, 05 Aug 2025 16:45:14 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 05 Aug 2025 16:45:14 +0200
changeset 250
d766b4f033d7
parent 249
2522fbeccede
child 251
2e2d4c3bf1cd

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;
--- a/src/ascension/2d.h	Mon Aug 04 23:19:06 2025 +0200
+++ b/src/ascension/2d.h	Tue Aug 05 16:45:14 2025 +0200
@@ -43,7 +43,6 @@
 } AscRectangle;
 
 struct asc_rectangle_create_args {
-    asc_rect bounds;
     int x;
     int y;
     int origin_x;

mercurial