fix that the origin was not applied in asc_rectangle_set_bounds()

Tue, 05 Aug 2025 16:48:04 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 05 Aug 2025 16:48:04 +0200
changeset 251
2e2d4c3bf1cd
parent 250
d766b4f033d7
child 252
42e8695372f7

fix that the origin was not applied in asc_rectangle_set_bounds()

src/2d.c file | annotate | diff | comparison | revisions
--- a/src/2d.c	Tue Aug 05 16:45:14 2025 +0200
+++ b/src/2d.c	Tue Aug 05 16:48:04 2025 +0200
@@ -164,9 +164,8 @@
 }
 
 void asc_rectangle_set_bounds(AscRectangle *rect, asc_rect bounds) {
-    // TODO: check how this harmonizes with a different origin
-    float x = (float) bounds.pos.x;
-    float y = (float) bounds.pos.y;
+    float x = (float) bounds.pos.x + rect->node.origin.x;
+    float y = (float) bounds.pos.y + rect->node.origin.y;
     float width = (float) bounds.size.width;
     float height = (float) bounds.size.height;
     bool update_transform = false;

mercurial