Repository navigation
FIX: ScrollViewer ignores padding when measuring children - #20025
martinflorek wants to merge 4 commits into
Conversation
|
You can test this PR using the following package version. |
|
|
@cla-avalonia agree |
|
I tested the build |
|
The problem in I am unable to create a Another issue I started thinking about is: what does a padding in a scrolling view mean in general? Personally I want the "padding to scroll with the content", but some will probably expect a fixed padding like in other views i.e., fixed inset "frame" around the content, that scrolls within it. Maybe a scrolling view should not have a padding property at all? @timunie @trashhacker ? |
|
The team will review the PR once we have enough capacity for it. About the last question: would be interesting to evaluate what other frameworks like WPF do about the padding. |
|
Note that there are various problems with Margin handling too. will break |
|
You can test this PR using the following package version. |
|
The fix in this PR doesn't handle the padding correctly in all cases. |
What does the pull request do?
ScrollViewer now honors padding when measuring its children. Should fix #17158. The bug looks to be in the ScrollContentPresenter, not the ScrollViewer itself.
I am not 100% sure if this is all that is needed to fix the ScrollViewer with padding scrolling issue. This is my first look at Avalonia source code.
What is the current behavior?
Currently the ScrollViewer ignores its padding when measuring its children. And in case when it cannot scroll horizontally or vertically, it is unable to scroll to the very end, see #17158
What is the updated/expected behavior with this PR?
ScrollViewer should use its padding to limit the available size when measuring its children.
Checklist
Breaking changes
Probably none, because the current behaviour is broken and ScrollViewer cannot be scrolled to the very end.
Fixed issues
Fixes #17158
Fixes #12182