# HG changeset patch # User Tero Marttila # Date 1410731355 -10800 # Node ID 5b2b866ad0a37ae9e0780adbdfefe04be15d0ea1 # Parent 22efa9fe73c83fd97720a2f791096e6e5a4561bd pngtile.tile: fix render_region centering diff -r 22efa9fe73c8 -r 5b2b866ad0a3 pngtile/tile.py --- a/pngtile/tile.py Mon Sep 15 00:15:51 2014 +0300 +++ b/pngtile/tile.py Mon Sep 15 00:49:15 2014 +0300 @@ -39,7 +39,7 @@ Scale value about center by zoom. """ - return scale(val - dim / 2, zoom) + return scale(val, zoom) - dim / 2 class TileApplication (BaseApplication): def __init__ (self, **opts): @@ -63,8 +63,8 @@ if zoom > MAX_ZOOM: raise exceptions.BadRequest("Image zoom: %d > %d" % (zoom, MAX_ZOOM)) - x = scale(x, zoom) - y = scale(y, zoom) + x = scale_center(x, width, zoom) + y = scale_center(y, height, zoom) try: return image.tile_mem(width, height, x, y, zoom)