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

Feature: UI for locking canvas size aspect ratio #1172

Merged

Conversation

ShirleyNekoDev
Copy link
Member

closes #1125

image
image

This PR builds upon #1171

@leMaik
Copy link
Member

leMaik commented Feb 25, 2022

Wow, the UI for this is amazing! 🤩

@ShirleyNekoDev
Copy link
Member Author

~ fixed wrongly copy-pasted copyright notice

@leMaik

This comment was marked as outdated.

@leMaik

This comment was marked as outdated.

@ShirleyNekoDev
Copy link
Member Author

~ rebased onto master

@ShirleyNekoDev
Copy link
Member Author

~ rebased onto master (and messed up git on the way)

chunky/src/res/style.css Outdated Show resolved Hide resolved
lib/src/se/llbit/chunky/ui/SizeInput.java Outdated Show resolved Hide resolved
lib/src/se/llbit/chunky/ui/SizeInput.java Outdated Show resolved Hide resolved
lib/src/se/llbit/chunky/ui/SizeInput.java Outdated Show resolved Hide resolved
lib/src/se/llbit/math/QuickMath.java Outdated Show resolved Hide resolved
chunky/src/res/style.css Outdated Show resolved Hide resolved
chunky/src/res/style.css Outdated Show resolved Hide resolved
@leMaik
Copy link
Member

leMaik commented Mar 8, 2022

minor bug: one can enter a 0 in the image dimensions, which causes an exception and somehow the validation thinks it's fine

I think the ratio/resize calculation has rounding issues.

  1. enter 1920 x 1080
  2. apply, lock ratio
  3. enter 2160 as height
    → expected: width updates accordingly, ratio 16:9
    → actual: 💥 width somehow becomes 4.330 (yes, with a comma), ratio is now 433 : 216

chunky/src/res/style.css Outdated Show resolved Hide resolved
chunky/src/res/style.css Outdated Show resolved Hide resolved
@leMaik leMaik merged commit 01401db into chunky-dev:master Mar 10, 2022
@ShirleyNekoDev ShirleyNekoDev deleted the feature-1125-lock-aspect-ratio branch March 10, 2022 23:50
@Peregrine05
Copy link
Member

Is this a problem for this PR?
image
As you can see, the resolution in the resolution boxes of the scene tab does not match that of the render preview.
My default resolution is set to 960x600, but the resolution boxes always display 400x400, regardless of the default or the actual setting.

@leMaik
Copy link
Member

leMaik commented Mar 14, 2022

@Peregrine05 Can you create a new issue, please?

@Peregrine05
Copy link
Member

All right.

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

Successfully merging this pull request may close these issues.

Add lock button to scene width/height to keep the aspect ratio while changing one of them
3 participants