Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(LocationSettings): Add drop ratio to grid settings #1347

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

Kruptein
Copy link
Owner

@Kruptein Kruptein commented Jan 9, 2024

[This performs a database migration]

This is a new feature that at the same time also is a bugfix.
It adds a new setting to the location grid setting.

context:
PA has an option to auto scale assets when dropped if they have a specific format in their name. For example goblin_1x1 should in normal circumstances fit exactly 1 grid cell, dragon_3x3 should be resized to 3 by 3 grid cells.

The existing implementation was erroneously using a method to do this based on the common 5ft system to automatically adjust this when a location had a bigger size (e.g. 10ft maps would automatically make something_2x2 fit in 1 cell)

This however completely breaks for everything that does not use the 5ft system, be it because you use SI units or because your system uses something custom or you enjoy defining your sizes in terms of pizzas.

The simple fix is to disable that system, but then dropping assets on maps that have a different scale no longer works properly. So to address that as well, a new setting is added that defines how these assets should be scaled when dropped on the map.

A drop ratio of 1 is the default, it means the asset will resize purely on it's specified dimensions.
A drop ratio of 0.5 would resize a something_2x2 to 1x1.

This fixes #1345.

@Kruptein Kruptein merged commit 5e13397 into dev Jan 9, 2024
5 checks passed
@Kruptein Kruptein deleted the feature/drop-ratio branch January 9, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] PA wrongly scale assets automatically
1 participant