dotnet / dotnet/maui

Image "AspectFit" not centered

Open
#9,971 6 comments 5 reactions 0 assignees View on GitHub
area-controls-image platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

When using `Image` with ` Aspect="AspectFit"` I am seeing only the top of the image when resizing. Should this not be the center of the image?

**Example**

Full Image
![Screenshot 2022-09-07 144709](https://user-images.githubusercontent.com/13089175/188895282-af59c1f4-1189-4bfd-a730-8d9d14b7e76f.png)

Aspect Fill Kicking In
![Screenshot 2022-09-07 144726](https://user-images.githubusercontent.com/13089175/188895093-3df8e93b-8e25-42c1-8938-c9d19f63c2ee.png)

Note: We are looking at the top image. Ignore the bottom image.

### Steps to Reproduce

Run project, resize window.

### Link to public reproduction project repository

https://github.com/Ruddy2007/MAUI-Image-Issue

### Version with bug

6.0.486 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Windows, I was *not* able test on other platforms

### Affected platform versions

10.0.19044

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the public reproduction project at https://github.com/Ruddy2007/MAUI-Image-Issue on Windows 10. Resize the window with the Image configured as AspectFit and compare the result with the attached screenshots. Done means the image remains centered rather than showing only its top during resizing.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.