1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 17:53:47 +00:00

editor: fix entity rotation logic

entity will no longer insta-rotate when clicked
This commit is contained in:
fgenesis 2024-07-14 01:51:13 +02:00
parent 0153c977df
commit 5c4e4450ba

View file

@ -2659,7 +2659,10 @@ void SceneEditor::update(float dt)
{ {
if (editingEntity) 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()) if (core->getCtrlState())
{ {
int a = (oldRotation + add)/45; int a = (oldRotation + add)/45;