From 546495fd8756cc46366f5b3b425cc6fa60262d59 Mon Sep 17 00:00:00 2001 From: vvashchenko <vitaliy.vashchenko@nic.cz> Date: Mon, 18 Jul 2016 15:50:45 +0200 Subject: [PATCH] #398 Added rotation animation. Changed rotation direction. --- .../tablexia/util/listener/DragAndRotateActorListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java b/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java index 124acf3ee..47973f369 100644 --- a/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java +++ b/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java @@ -164,8 +164,9 @@ public class DragAndRotateActorListener extends InputListener { if (tapped) { if (lastTouch != null) { if (tempTouch.isDoubleTap(lastTouch)) { - lastTouch.getTouchedActor().rotateBy(90); - rotated((lastTouch.getTouchedActor().getRotation() + 90), lastTouch.getTouchedActor()); + Actor actorToRotate = lastTouch.getTouchedActor(); + actorToRotate.addAction(Actions.rotateTo(actorToRotate.getRotation()-90, 0.5f)); + rotated(actorToRotate.getRotation() - 90, actorToRotate); } else { lastTouch = new Touch(draggedActor, (tempTouch.getTime() + newTouch.getTime()) / 2); //not double - save least touch } -- GitLab