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

Fix image render area #1696

Merged
merged 6 commits into from
Dec 25, 2024
Merged

Conversation

Kuuuube
Copy link
Member

@Kuuuube Kuuuube commented Dec 24, 2024

Fixes #1694

Prevents the canvas image from being rendered with the size defined in the dictionary. This size often does not match the size of the image and effectively crops out parts of the image that are not in the bounds rather than scaling to those bounds. Images that are smaller than the size defined in the dictionary are cropped bigger instead of resizing causing extra empty padding to be added to the image.

Instead of the canvas handling the scaling, imageContainer should do it.

Would like comment from @djahandarie as I'm not entirely sure if the part I've removed in be22e85 was a hacky workaround due to not scaling the canvas properly or if there's another purpose for it. In my testing I haven't noticed any issues with image scaling or rendering from this with dictionaries that use em for sizeUnits after this change.

Tested on Chromium and Firefox.

@Kuuuube Kuuuube added kind/bug The issue or PR is regarding a bug area/ui-ux The issue or PR is related to UI/UX/Design regression This issue or PR is related to a regression labels Dec 24, 2024
@Kuuuube Kuuuube requested a review from a team as a code owner December 24, 2024 23:48
@Kuuuube
Copy link
Member Author

Kuuuube commented Dec 24, 2024

Anki seems to not support something with the styling here. Will have to look into that further.

@Kuuuube
Copy link
Member Author

Kuuuube commented Dec 25, 2024

This should be good to go. Anki stuff is working properly now.

@Kuuuube Kuuuube added this pull request to the merge queue Dec 25, 2024
Merged via the queue into yomidevs:master with commit 585854d Dec 25, 2024
11 checks passed
@Kuuuube Kuuuube deleted the fix-image-render-area branch December 25, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-ux The issue or PR is related to UI/UX/Design kind/bug The issue or PR is regarding a bug regression This issue or PR is related to a regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in 24.12.24.0 for displaying structured content images
2 participants