From 413bc7c5aeb7d52e2a47df276b58e8c3434d8d78 Mon Sep 17 00:00:00 2001 From: JohnieWalkerCZ Date: Fri, 10 Jul 2026 14:01:24 +0200 Subject: [PATCH] fix: invalidate rotation/dirty caches in setRotationAngle, setX, setY setRotationAngle updated _rotationAngle without invalidating the trig cache or marking the global matrix dirty, unlike rotate() which does both. setX/setY had the same gap versus setPosition()/translate(). Both left globalMatrix() returning stale transforms after the call. Co-Authored-By: Claude Sonnet 5 --- include/Shapes/Shape.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/Shapes/Shape.hpp b/include/Shapes/Shape.hpp index 18b4ec3..990a8e1 100644 --- a/include/Shapes/Shape.hpp +++ b/include/Shapes/Shape.hpp @@ -139,18 +139,22 @@ class Shape { void setX(int x) { _x = x; + markDirty(); if (collider) collider->x = x; } void setY(int y) { _y = y; + markDirty(); if (collider) collider->y = y; } void setRotationAngle(float angle) { _rotationAngle = angle; + invalidateTrigCache(); + markDirty(); if (collider) collider->rotation = angle; }