From 63a03f6772b8c008c3b7e6d17e484f585244a5e7 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 30 Dec 2016 12:31:44 +0100 Subject: mpta-crosshairs manual test: correct the velocity vector rotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit acos cannot return any possible angle, but atan2 can. Change-Id: Ic277bc1d3616900775b6076dce6b05bdf3c35da3 Reviewed-by: Jan Arve Sæther --- tests/manual/touch/mpta-crosshairs.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/manual/touch') diff --git a/tests/manual/touch/mpta-crosshairs.qml b/tests/manual/touch/mpta-crosshairs.qml index 8b71e4fdc3..a55dfc7799 100644 --- a/tests/manual/touch/mpta-crosshairs.qml +++ b/tests/manual/touch/mpta-crosshairs.qml @@ -98,7 +98,8 @@ Rectangle { height: 1 x: touchPoint.x y: touchPoint.y - rotation: width > 0 ? Math.acos(touchPoint.velocity.x / width) : 0 + rotation: width > 0 ? Math.atan2(touchPoint.velocity.y, touchPoint.velocity.x) * 180 / Math.PI : 0 + Behavior on rotation { SmoothedAnimation { duration: 20 } } transformOrigin: Item.BottomLeft } -- cgit v1.2.3