diff web/templog.py @ 548:b3dc81bee5b3

scaled zooming works
author Matt Johnston <matt@ucc.asn.au>
date Wed, 27 May 2015 22:37:43 +0800
parents 30628aa50a10
children 141948a400a6
line wrap: on
line diff
--- a/web/templog.py	Wed May 27 22:17:39 2015 +0800
+++ b/web/templog.py	Wed May 27 22:37:43 2015 +0800
@@ -107,7 +107,8 @@
     if 'zoom' in request.query:
         orig_start = end - timedelta(minutes=minutes)
         orig_end = end
-        xpos = int(request.query.x)
+        scale = float(request.query.scaledwidth) / config.GRAPH_WIDTH
+        xpos = int(request.query.x) / scale
         xpos -= config.GRAPH_LEFT_MARGIN * config.ZOOM
 
         if xpos >= 0 and xpos < config.GRAPH_WIDTH * config.ZOOM: