From c73aa2390668ea8e28576d8cf37db9f1b6bfe1c5 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Fri, 5 May 2023 03:49:14 +0200 Subject: [PATCH] Use multiplicative scaling in anim editor for a more uniform feel --- Aquaria/AnimationEditor.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Aquaria/AnimationEditor.cpp b/Aquaria/AnimationEditor.cpp index a72eaab..df4b6f3 100644 --- a/Aquaria/AnimationEditor.cpp +++ b/Aquaria/AnimationEditor.cpp @@ -735,27 +735,28 @@ void AnimationEditor::update(float dt) if (isActing(ACTION_SWIMDOWN, -1)) moveBoneStripPoint(Vector(0, dt)); } - int spd = 1; + float spd = 1.0f; if (core->mouse.scrollWheelChange < 0) { - ctrlSprite->scale -= Vector(spd*0.05f,spd*0.05f); + ctrlSprite->scale.x /= 1.12f; } else if (core->mouse.scrollWheelChange > 0) { - ctrlSprite->scale += Vector(spd*0.05f,spd*0.05f); + ctrlSprite->scale.x *= 1.12f; } if (core->getKeyState(KEY_PGDN) && core->getShiftState()) { - ctrlSprite->scale -= Vector(spd*0.05f,spd*0.05f); + ctrlSprite->scale.x /= (1 + spd*dt); } if (core->getKeyState(KEY_PGUP) && core->getShiftState()) { - ctrlSprite->scale += Vector(spd*0.05f,spd*0.05f); + ctrlSprite->scale.x *= (1 + spd*dt); } if (ctrlSprite->scale.x < 0.05f) { - ctrlSprite->scale = Vector(0.05f,0.05f); + ctrlSprite->scale.x = 0.05f; } + ctrlSprite->scale.y = ctrlSprite->scale.x; if (boneEdit == 0) {