Fixed offset issues on generated image
This commit is contained in:
parent
ca36269380
commit
2dc70f590d
@ -270,7 +270,6 @@ class Inkycal:
|
||||
|
||||
# Get the size of the section
|
||||
section_size = self.Settings.get_config(module)['size']
|
||||
|
||||
# Calculate coordinates to center the image
|
||||
x = int( (section_size[0] - im1_size[0]) /2)
|
||||
|
||||
@ -278,13 +277,14 @@ class Inkycal:
|
||||
if im1_cursor == 0:
|
||||
y = int( (section_size[1]-im1_size[1]) /2)
|
||||
else:
|
||||
y = im1_cursor
|
||||
y = im1_cursor + int( (section_size[1]-im1_size[1]) /2)
|
||||
|
||||
|
||||
# center the image in the section space
|
||||
im_black.paste(im1, (x,y), im1)
|
||||
|
||||
# Shift the y-axis cursor at the beginning of next section
|
||||
im1_cursor += section_size[1] - y
|
||||
im1_cursor += section_size[1]
|
||||
|
||||
# Check if there is an image for the coloured band
|
||||
if exists(im2_path):
|
||||
@ -303,13 +303,13 @@ class Inkycal:
|
||||
if im2_cursor == 0:
|
||||
y = int( (section_size[1] - im2_size[1] ) /2)
|
||||
else:
|
||||
y = im2_cursor
|
||||
y = im2_cursor + int( (section_size[1]-im2_size[1]) /2)
|
||||
|
||||
# center the image in the section space
|
||||
im_colour.paste(im2, (x,y), im2)
|
||||
|
||||
# Shift the y-axis cursor at the beginning of next section
|
||||
im2_cursor += section_size[1] - y
|
||||
im2_cursor += section_size[1]
|
||||
|
||||
if self.optimize == True:
|
||||
self._optimize_im(im_black).save(images+'canvas.png', 'PNG')
|
||||
|
Loading…
Reference in New Issue
Block a user