Permalink
Browse files

Make it possible to render map when the layers don't have the same si…

…zes.
  • Loading branch information...
1 parent 8a6c258 commit 1377513a10f71368d6bb508d9d8f28ccb2c7fab1 @erdbeere erdbeere committed Dec 20, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 tml.py
View
6 tml.py
@@ -397,7 +397,11 @@ def render(self):
if hasattr(layer, 'render'):
layer_im = layer.render()
region = (0, 0, layer_im.size[0], layer_im.size[1])
- im = PIL.ImageChops.composite(layer_im, im, layer_im)
+ # create a transparent layer the size of the image and draw the
+ # tile-/quadlayer in that layer.
+ tmp_im = PIL.Image.new('RGBA', im.size, (0,0,0,0))
+ tmp_im.paste(layer_im, (0, 0))
+ im = PIL.ImageChops.composite(tmp_im, im, tmp_im)
return im
def __repr__(self):

0 comments on commit 1377513

Please sign in to comment.