mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-20 05:00:59 +00:00
Allow negative coordinates when using an anchor
This commit is contained in:
parent
dd5efac0eb
commit
6cca16ef99
1 changed files with 2 additions and 2 deletions
|
|
@ -128,8 +128,8 @@ class ResizeCanvas(object):
|
|||
def process(self, img):
|
||||
new_img = Image.new('RGBA', (self.width, self.height), self.color)
|
||||
if self.anchor:
|
||||
x = int(abs(self.width - img.size[0]) * Anchor._ANCHOR_PTS[self.anchor][0])
|
||||
y = int(abs(self.height - img.size[1]) * Anchor._ANCHOR_PTS[self.anchor][1])
|
||||
x = int((self.width - img.size[0]) * Anchor._ANCHOR_PTS[self.anchor][0])
|
||||
y = int((self.height - img.size[1]) * Anchor._ANCHOR_PTS[self.anchor][1])
|
||||
else:
|
||||
x, y = self.x, self.y
|
||||
new_img.paste(img, (x, y))
|
||||
|
|
|
|||
Loading…
Reference in a new issue