chunky-dev / chunky-dev/chunky

Canvas size lock functionality doesn't handle non-integer multiples of aspect ratio cleanly

Open
#1,488 1 comment 0 reactions 0 assignees View on GitHub
GUI
Dominant language
Java
Stars
738
Forks
78
Avg merge
10h 5m
Merged PRs (30d)
3

Description

When the aspect ratio of the canvas size is locked, manually entering a new width that doesn't divide the aspect ratio cleanly then changing it back will usually leave rounding errors and a few pixels more or less.

Example:
- Set canvas size to 16:9 (eg 960x540) and lock aspect ratio
![screenshot-20221020-205534](https://user-images.githubusercontent.com/63167642/197045304-8c0385e4-15e7-44c7-8788-97bfdec9d3db.png)
- Change height to something that doesn't divide 9 cleanly (eg 400) and set this to be the new resolution by pressing enter
![screenshot-20221020-205728](https://user-images.githubusercontent.com/63167642/197045636-1497f557-7af5-4045-8578-868548029a26.png)
- Change height back to 540, and notice how how width is now 962
![screenshot-20221020-205915](https://user-images.githubusercontent.com/63167642/197045980-374f20d2-13a2-44b9-861b-45911882e190.png)

I realise how this is technically correct from an implementation standpoint, but it's not very intuitive - perhaps store the original aspect ratio whenever the lock icon is enabled, and don't update it until the lock is disabled? This could enable a workflow where the only way to change aspect ratio is an explicit unlocking of the width and height, which I think is more intuitive.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.