test/snake/snake.c

changeset 189
2c063b225183
parent 186
e9bb4d4f88a8
child 193
ddf690c0b36b
--- a/test/snake/snake.c	Mon Jul 07 22:41:48 2025 +0200
+++ b/test/snake/snake.c	Mon Jul 07 22:51:06 2025 +0200
@@ -70,11 +70,13 @@
     if (asc_test_flag(node->flags, ASC_SCENE_NODE_GRAPHICS_UPDATED) || asc_active_window->resized) {
         asc_vec2u bottom_right = asc_active_window->dimensions;
         asc_vec2u text_size = ((AscText*)node)->dimension;
-        asc_set_position2d(
-                node,
-                (int)bottom_right.x - (int)text_size.width - 10,
-                (int)bottom_right.y - (int)text_size.height - 10
-        );
+        asc_transform new_transform;
+        asc_transform_identity(new_transform);
+        asc_transform_translate2f(new_transform, ASC_VEC2F(
+                (int) bottom_right.x - (int) text_size.width - 10,
+                (int) bottom_right.y - (int) text_size.height - 10
+        ));
+        asc_node_transform_set(node, new_transform);
     }
 }
 

mercurial