From 84726988dad28ad4b7e77dcda7baddda094b90dd Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 15 Oct 2020 15:45:36 +0300 Subject: startupscreen: fix up movement for clock hands Avoid hardcoded sizes and positions to make clock hands centered and rotate on correct axes. Change-Id: I9d5e80fbf785a34dc1fc81f57d57886efff31b23 Reviewed-by: Rami Potinkara --- startupscreen/AnalogClock.qml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'startupscreen') diff --git a/startupscreen/AnalogClock.qml b/startupscreen/AnalogClock.qml index a430227..c7d5643 100644 --- a/startupscreen/AnalogClock.qml +++ b/startupscreen/AnalogClock.qml @@ -105,7 +105,7 @@ Item { transform: Rotation { id: hourRotation - origin.x: 2 + origin.x: wideDial / 2 origin.y: clockRadius/2 angle: (clock.hours * 30) + (clock.minutes * 0.5) Behavior on angle { @@ -120,16 +120,16 @@ Item { Rectangle { id: minuteDial x: clockRadius - (wideDial/2) - y: 32 + y: clockRadius * 0.3 width: wideDial - height: clockRadius - 32 + height: clockRadius * 0.7 color: "#53586b" radius: width/2 transform: Rotation { id: minuteRotation - origin.x: 2 - origin.y: clockRadius - 32 + origin.x: wideDial / 2 + origin.y: clockRadius * 0.7 angle: clock.minutes * 6 Behavior on angle { SpringAnimation { @@ -144,16 +144,16 @@ Item { Rectangle { id: secondHand x: clockRadius - (narrowDial/2) - y: 24 + y: clockRadius * 0.1 width: narrowDial - height: clockRadius - 24 + height: clockRadius * 0.9 color: "red" radius: width/2 transform: Rotation { id: secondRotation - origin.x: 1 - origin.y: clockRadius - 24 + origin.x: narrowDial / 2 + origin.y: clockRadius * 0.9 angle: clock.seconds * 6 Behavior on angle { SpringAnimation { -- cgit v1.2.3