negative shadow offset

This commit is contained in:
Frank DeMarco 2016-02-25 15:28:28 -05:00
parent eeb156b9e9
commit 6155bdcd7d
1 changed files with 2 additions and 2 deletions

View File

@ -172,8 +172,8 @@ def get_shadowed_text(text, font, offset, color, antialias=True, shadow_color=(0
foreground = font.render(text, antialias, color)
background = font.render(text, antialias, shadow_color)
alpha = SRCALPHA if antialias else 0
surface = Surface((foreground.get_width() + offset[0],
foreground.get_height() + offset[1]), alpha)
surface = Surface((foreground.get_width() + abs(offset[0]),
foreground.get_height() + abs(offset[1])), alpha)
if not antialias:
surface.set_colorkey(colorkey)
surface.fill(colorkey)