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

Constraining image dimensions #332

Closed
BenjaminIrwin opened this issue Sep 6, 2022 · 1 comment
Closed

Constraining image dimensions #332

BenjaminIrwin opened this issue Sep 6, 2022 · 1 comment

Comments

@BenjaminIrwin
Copy link

Is there any way to constrain the dimensions of the base layer in minipaint?

I want to make it so that the underlying canvas is always square in aspect ratio. I want to be able to add non-square images but still make sure config.WIDTH== config.HEIGHT at all times. For example: https://ibb.co/xXRdTXP

If it can't be done easily can you point me to the right alterations in the code? Thanks so much

@viliusle
Copy link
Owner

viliusle commented Sep 6, 2022

Menu > image > Canvas size does it, related code:
https://github.com/viliusle/miniPaint/blob/master/src/js/modules/image/size.js#L93

So you need to build your custom version and modify https://github.com/viliusle/miniPaint/blob/master/src/js/modules/file/open.js functions to keep square in aspect ratio. (search for "Autoresize_canvas_action")

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

No branches or pull requests

2 participants