Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Fixed join when col and row are specified #35

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

dinisov
Copy link

@dinisov dinisov commented Apr 12, 2020

Hi. This is my first pull request :)

There was a problem when performing a join() on a set of tiles generated when the number of cols and rows is specified, as opposed to calculated automatically from the total number of tiles. So for instance if col=6 and row=4 then join() would call calc_columns_rows(len(tiles)) at some point which would return col=4 and row=6, since the automatic calculations default to a higher number of rows.

I changed calc_columns_rows() to calculate rows and columns based on tile.coords to make it fool proof. As for the automatic calculations I moved them to the slice() function since in all likelihood they will only be run once. My code is not very elegant but I could not think of an obvious way to add cols and rows as global variables and did not want to add them to every Tile.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant