diff --git a/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java b/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java index 0d85f658c7a5598e88f8ade05e509109be178850..5b7bd225bd6e76bddee59e8b96cb897a936e4cd7 100644 --- a/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java +++ b/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java @@ -166,10 +166,11 @@ public class DragAndRotateActorListener extends InputListener { boolean tapped = tempTouch.isTap(newTouch); if (tapped) { if (lastTouch != null) { - if (tempTouch.isDoubleTap(lastTouch)) { + if (tempTouch.isDoubleTap(lastTouch) && !lastTouch.getTouchedActor().hasActions()) { Actor actorToRotate = lastTouch.getTouchedActor(); - actorToRotate.addAction(Actions.rotateTo(actorToRotate.getRotation()-90, 0.5f)); - rotated(actorToRotate.getRotation() - 90, actorToRotate); + float newRotationAngle = ArithmeticsHelper.getClosestRightAngle(actorToRotate.getRotation()-90); + actorToRotate.addAction(Actions.rotateTo(newRotationAngle, 0.5f)); + rotated(newRotationAngle, actorToRotate); } else { lastTouch = new Touch(draggedActor, (tempTouch.getTime() + newTouch.getTime()) / 2); //not double - save least touch }