Skip to content

Fix Image.rotate.fit_to_fraction size mismatch#8067

Open
jsalort wants to merge 2 commits intoemilk:mainfrom
jsalort:CalcSizeRotate
Open

Fix Image.rotate.fit_to_fraction size mismatch#8067
jsalort wants to merge 2 commits intoemilk:mainfrom
jsalort:CalcSizeRotate

Conversation

@jsalort
Copy link
Copy Markdown

@jsalort jsalort commented Apr 5, 2026

This PR proposes a fix to the clipped and wrong size when fit_to_fraction is used on a rotated image. I think there are two issues:

  • calc_size needs to compute the ratio on the rotated box size, not the original box size;
  • in paint_texture_at, the mesh.rotate may yield negative and inconsistent origin, so I propose to add a translation to keep the top-left coordinate fixed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

Preview is being built...

Preview will be available at https://egui-pr-preview.github.io/pr/8067-CalcSizeRotate

View snapshot changes at kitdiff

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

Successfully merging this pull request may close these issues.

Rotated image does not respect container boundaries, has wrong width/height ratio and is clipped

1 participant