Make use of tile_edge() in tile_bbox().
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Fri, 28 Jun 2019 18:59:37 +0000 (20:59 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Fri, 28 Jun 2019 18:59:37 +0000 (20:59 +0200)
gimp_passport.py

index b8d77da..ad9882d 100644 (file)
@@ -88,9 +88,9 @@ def tile_bbox(x: int, y: int, tile_size: Tuple[int, int], margin: int, spacing:
     :return: (left, top, right, bottom)
     """
     width, height = tile_size
-    left = margin + x * (width + spacing)
+    left = tile_edge(x, width, margin, spacing)
     right = left + width
-    top = margin + y * (height + spacing)
+    top = tile_edge(y, height, margin, spacing)
     bottom = top + height
     return left, top, right, bottom