From 5c4e4450ba92e4c4ada94fa00eb9c98c8e7bf1c4 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sun, 14 Jul 2024 01:51:13 +0200 Subject: [PATCH] editor: fix entity rotation logic entity will no longer insta-rotate when clicked --- Aquaria/SceneEditor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Aquaria/SceneEditor.cpp b/Aquaria/SceneEditor.cpp index 988aa36..a41264c 100644 --- a/Aquaria/SceneEditor.cpp +++ b/Aquaria/SceneEditor.cpp @@ -2659,7 +2659,10 @@ void SceneEditor::update(float dt) { if (editingEntity) { - float add = (dsq->getGameCursorPosition().x - cursorOffset.x)/2.4f; + float cx = dsq->getGameCursorPosition().x; + float ex = editingEntity->position.x; + float dx = cx + cursorOffset.x - ex; + float add = dx/2.4f; if (core->getCtrlState()) { int a = (oldRotation + add)/45;