diff web/templog.py @ 77:959e88c0bdfa

ui tweaks
author Matt Johnston <matt@ucc.asn.au>
date Wed, 04 Jul 2012 22:36:52 +0800
parents a8ff20f15734
children 3cd1ca6d0489
line wrap: on
line diff
--- a/web/templog.py	Tue Jul 03 23:12:06 2012 +0800
+++ b/web/templog.py	Wed Jul 04 22:36:52 2012 +0800
@@ -55,11 +55,11 @@
         orig_start = end - timedelta(minutes=minutes)
         orig_end = end
         xpos = int(request.query.x)
-        xpos -= config.GRAPH_LEFT_MARGIN
+        xpos -= config.GRAPH_LEFT_MARGIN * config.ZOOM
 
-        if xpos >= 0 and xpos < config.GRAPH_WIDTH:
+        if xpos >= 0 and xpos < config.GRAPH_WIDTH * config.ZOOM:
             click_time = orig_start \
-                + timedelta(minutes=(float(xpos) / config.GRAPH_WIDTH) * minutes)
+                + timedelta(minutes=(float(xpos) / (config.GRAPH_WIDTH * config.ZOOM)) * minutes)
             minutes = int(minutes / ZOOM_SCALE)
 
             end = click_time + timedelta(minutes=minutes/2)