Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Martin <gary@garycmartin.com>2013-05-25 13:13:34 (GMT)
committer Gary Martin <gary@garycmartin.com>2013-05-25 13:13:34 (GMT)
commit34746b719d1664ea51cde21f9fad40501beef621 (patch)
tree163f4aef82f4c736e5497b6ea763f36c89c3bfc1
parent3b4c36f9e0cd8752846d97dc9199a68a47e3d214 (diff)
Fix for SL#4508, In manual mode, dragging hour hand past 12 does not update AM/PM
-rwxr-xr-xclock.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/clock.py b/clock.py
index 9cc47a9..ce59049 100755
--- a/clock.py
+++ b/clock.py
@@ -1165,6 +1165,9 @@ font_desc="Sans Bold 40">%d</span></markup>') % (i + 1)
while tmp >= math.pi * 2:
tmp -= math.pi * 2
self._hand_angles['minutes'] = int((tmp * 60) / (math.pi * 2)) * (math.pi * 2) / 60.0
+ # Toggle AM/PM as needed
+ if abs(self._hand_angles['hour'] - pointer_angle) > math.pi:
+ self.toggle_am_pm()
# Update the angle of the hand being grabbed
self._hand_angles[self._hand_being_grabbed] = pointer_angle