From c0ac410009ed08fe56bb19aa807ed944b34f2ca6 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Wed, 8 May 2024 03:05:29 +0200 Subject: [PATCH] Fix editor single-axis scaling sliding the tile around This re-implements movement compensation previoulsy done by RenderObject::beforeScaleOffset, that got removed in 048a787cb1faaeeac0f. Turns out all that needs to be done is to take tile rotation into account. (The removed FIXME comment has nothing to do with it; it's just a leftover that turned out to work fine as-is) --- Aquaria/SceneEditor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Aquaria/SceneEditor.cpp b/Aquaria/SceneEditor.cpp index 5aef7ca..c4cf0d1 100644 --- a/Aquaria/SceneEditor.cpp +++ b/Aquaria/SceneEditor.cpp @@ -2400,8 +2400,6 @@ bool SceneEditor::isOn() void SceneEditor::updateText() { - // FIXME: make sure this isn't called while the editor isn't active - btnMenu->position = Vector(20, 20 - core->getVirtualOffY()); const Vector cursor = dsq->getGameCursorPosition(); @@ -2773,6 +2771,7 @@ void SceneEditor::update(float dt) if(!middle && !uni && selectedTiles.size() == 1) { Vector offsetChange = (add*Vector(multi->getWidth(), multi->getHeight()))*0.5f; + offsetChange.rotate2D360(multi->rotation.z); if (add.y == 0) { if (right)