Attempt to take padding account when calculating output width cell count
This commit is contained in:
@@ -15,7 +15,7 @@ class ImageAssembler:
|
|||||||
self.output = Image.new('RGBA', (metadata['width'], metadata['height']), (255, 255, 255, 0))
|
self.output = Image.new('RGBA', (metadata['width'], metadata['height']), (255, 255, 255, 0))
|
||||||
|
|
||||||
# TODO double check this logic
|
# TODO double check this logic
|
||||||
self.output_width_cells = math.ceil(float(metadata['width']) / cell_size)
|
self.output_width_cells = 1 + math.ceil(float(metadata['width'] - cell_size) / (cell_size - 2*padding))
|
||||||
|
|
||||||
def atlas_get_cell(self, cell_no: int):
|
def atlas_get_cell(self, cell_no: int):
|
||||||
cell_x_pos = cell_no % self.atlas_width_cells
|
cell_x_pos = cell_no % self.atlas_width_cells
|
||||||
|
|||||||
Reference in New Issue
Block a user