microsoft / microsoft/microsoft-ui-xaml
ScrollView ignores one axis of center point if animationis disabled
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
ScrollView ignores one axis of center point when using ZoomTo/ZoomBy if animation is disabled
### Why is this important?
When you try to zoom on click, ScrollView zooms to another point that could frustrate users. It works with animation, but not every zoom requires it.
### Steps to reproduce the bug
1. Create a page containing:
```
```
2. Code behind:
```
ScrollingZoomOptions disableOptions = new(ScrollingAnimationMode.Disabled, ScrollingSnapPointsMode.Ignore);
private void ZoomScrollViewer_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
{
var viewportPoint = e.GetPosition(ZoomScrollViewer).ToVector2();
ZoomScrollViewer.ZoomTo(1, viewportPoint, disableOptions);
}
```
3. Zoom out with mouse or touchpad
4. Double click on an image
### Actual behavior
Image is zoomed to point (X,0) or (0,Y), where X,Y - point of click
### Expected behavior
Image is zoomed directly into the point of click
### Screenshots
_No response_
### NuGet package version
2.4.0
### Windows version
Windows 11 (25H2): Build 26200
### Additional context
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided ScrollView, ZoomTo call, and disabled ScrollingAnimationMode. Trace the ScrollView ZoomTo/ZoomBy behavior for disabled animation and verify the fix by confirming that both coordinates target the double-click position, then repeat the repro with animation enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100