mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-01-26 02:07:26 +00:00
Fix editor single-axis scaling sliding the tile around
This re-implements movement compensation previoulsy done by
RenderObject::beforeScaleOffset, that got removed in 048a787cb1
.
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)
This commit is contained in:
parent
09f3cc4096
commit
c0ac410009
1 changed files with 1 additions and 2 deletions
|
@ -2400,8 +2400,6 @@ bool SceneEditor::isOn()
|
||||||
|
|
||||||
void SceneEditor::updateText()
|
void SceneEditor::updateText()
|
||||||
{
|
{
|
||||||
// FIXME: make sure this isn't called while the editor isn't active
|
|
||||||
|
|
||||||
btnMenu->position = Vector(20, 20 - core->getVirtualOffY());
|
btnMenu->position = Vector(20, 20 - core->getVirtualOffY());
|
||||||
|
|
||||||
const Vector cursor = dsq->getGameCursorPosition();
|
const Vector cursor = dsq->getGameCursorPosition();
|
||||||
|
@ -2773,6 +2771,7 @@ void SceneEditor::update(float dt)
|
||||||
if(!middle && !uni && selectedTiles.size() == 1)
|
if(!middle && !uni && selectedTiles.size() == 1)
|
||||||
{
|
{
|
||||||
Vector offsetChange = (add*Vector(multi->getWidth(), multi->getHeight()))*0.5f;
|
Vector offsetChange = (add*Vector(multi->getWidth(), multi->getHeight()))*0.5f;
|
||||||
|
offsetChange.rotate2D360(multi->rotation.z);
|
||||||
if (add.y == 0)
|
if (add.y == 0)
|
||||||
{
|
{
|
||||||
if (right)
|
if (right)
|
||||||
|
|
Loading…
Reference in a new issue