diff web/templog.py @ 249:c490de0cf17e

scaled zooming works
author Matt Johnston <matt@ucc.asn.au>
date Wed, 27 May 2015 22:37:43 +0800
parents 2071d939e4ff
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: