Skip to content

Update ImageMeasure to apply aspect ratio to min/max height/width #19577

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

UkoeHB
Copy link
Contributor

@UkoeHB UkoeHB commented Jun 11, 2025

Objective

Solution

  • Apply aspect ratio multiple times to 'draw back' the image size if it leaks outside min/max bounds after the first aspect ratio application.

Testing

  • Updated the ui_scaling example to demonstrate.

@UkoeHB
Copy link
Contributor Author

UkoeHB commented Jun 11, 2025

@ickshonpe trying to get this to work, but ran into a deeper problem. Even if the ContentSize says one thing, if you have a fixed width or height then the actual node size may be different. And extract_uinode_images uses the node size, not the adjusted size.

I am at a loss.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 11, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16.2 milestone Jun 11, 2025
@alice-i-cecile alice-i-cecile added S-Needs-Help The author needs help finishing this PR. and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior S-Needs-Help The author needs help finishing this PR.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

ImageMeasure does not apply aspect_ratio to max width/height
2 participants