test/snake/snake.c

changeset 262
b47de42f4598
parent 260
2649d04f0287
--- a/test/snake/snake.c	Sat Aug 09 14:36:39 2025 +0200
+++ b/test/snake/snake.c	Tue Aug 12 21:04:59 2025 +0200
@@ -121,11 +121,7 @@
 }
 
 static void main_scene_frame_scale(AscBehavior *behavior) {
-    // TODO: we cannot skip this behavior when window is resized,
-    //       because the viewport is updated after executing all behaviors
-    //       and then the resized flag is cleared already.
-    //       A possible solution is to add something like a post-rendering behavior.
-    //       Another solution would be a viewport-changed-event (once we implement events)
+    if (!asc_active_window->resized) return;
     asc_ptr_cast(AscRectangle, frame, behavior->node);
     asc_rectangle_set_bounds(frame, MAIN_SCENE->camera.viewport);
 }

mercurial