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

[Desktop] ScrollView content visible outside the scroll area. #18299

Open
agneszitte opened this issue Sep 25, 2024 Discussed in #18289 · 12 comments
Open

[Desktop] ScrollView content visible outside the scroll area. #18299

agneszitte opened this issue Sep 25, 2024 Discussed in #18289 · 12 comments
Assignees
Labels
area/skia/composition ✏️ area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Comments

@agneszitte
Copy link
Contributor

agneszitte commented Sep 25, 2024

Discussed in #18289

Originally posted by @mcNets September 24, 2024:

Working in my last app I noticed that sometimes the content of a ScrollView or part of the content, in this case just the Border, is visible outside the scroll area.

I'm using a FeedView where the NormalTemplate has a GridView inside a ScrollView.

How to reproduce

Download the attached solution and execute the desktop project, then scroll up the content by clicking the small arrow at the bottom of the scrollbar. The card's border is visible outside the scroll area.

In my application it happens scrolling the content using the scrollbar no matter where, in this one, at least in my computer only by clicking the bottom arrow.

TestScrollView

TestScrollView.zip


@agneszitte -> On my side, I am not able to reproduce the issue at all.

@Xiaoy312 Was able to reproduce the issue on his side.

Here are additional details for the repro steps for him:
repro: page-up/down, mouse wheel scroll
no-repro: dragging scrollbar, arrow-up/down

His comment:

The problem is related to the CornerRadius, if you remove the CornerRadius from MachinesItemNormalTemplate the issue is no longer reproducible.

Likely Skia-specific, we would need to review the implementation of BorderVisual with CornerRadius which is a skia-specific feature

@Xiaoy312 can reproduce the issue with Uno.Sdk 5.3.108 and also with Uno.Sdk 5.4.5 or latest 5.5.0-dev

@mcNets
Copy link
Contributor

mcNets commented Sep 26, 2024

Is it because of this?

if (_backgroundBrush is { } && !_backgroundPathValid)
{
_backgroundPathValid = true;
// We don't pass down <inner|outer>Area directly, since it contains the thickness offsets.
// Instead, we only pass the Size (without the X and Y offsets).
// The offsets shouldn't be part of the background path calculations, but should be done
// at the point of rendering by translation the final output by the thickness.
// This matters because if the path is for an image with a scaling RelativeTransform.
// In that case, if you factor the thickness in the path itself (i.e. include it in SKPath.Bounds),
// the shader will sample from the image after the offset is applied.
// E.g., if we have a border with a 20px border thickness and 100x100 background area for an ImageBrush with a
// RelativeTransform = ScaleTransform { ScaleX = 3, ScaleY = 3, CenterX = 0.5, CenterY = 0.5 }, here's what we want:
// |-----------------300px---------------------|

@ramezgerges ramezgerges self-assigned this Sep 26, 2024
@Youssef1313 Youssef1313 added area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/skia/composition ✏️ labels Sep 26, 2024
@agneszitte
Copy link
Contributor Author

agneszitte commented Sep 27, 2024

@mcNets Can you confirm that you are still able to reproduce the issue 100% of the time with this sample app (by clicking the small down arrow of the scrollbar) even with the latest Uno.Sdk 5.4.5 please? (5.4 migration notes for info)

At the moment @Xiaoy312 is the only one that is able to reproduce the issue, but the repro is a little bit different (by using mouse wheel scroll).

@ramezgerges
Copy link
Contributor

I can't repro at all on my side. It's extremely weird that different ways of scrolling affect the repro differently. The final vertical offset is all that should matter.

@ramezgerges ramezgerges removed their assignment Sep 27, 2024
@mcNets
Copy link
Contributor

mcNets commented Sep 28, 2024

@agneszitte yes I can. I updated to 5.4.5 and still happening. In fact in my actual project I'm on "Uno.Sdk": "5.5.0-dev.62".

It disappears when I set BorderThicknes=0 even if there is a CornerRadius > 0.

@agneszitte
Copy link
Contributor Author

agneszitte commented Sep 30, 2024

@agneszitte yes I can. I updated to 5.4.5 and still happening. In fact in my actual project I'm on "Uno.Sdk": "5.5.0-dev.62".

It disappears when I set BorderThicknes=0 even if there is a CornerRadius > 0.

Thank you a lot for the feedback @mcNets, we will continue to investigate (cc @jeromelaban for info)

@nickrandolph
Copy link
Contributor

@agneszitte / @jeromelaban can we get this prioritised as it's affecting a lot of scenarios where scrolling happens. The workaround seems to be setting a background on the panel where the bleed through is showing but ideally this shouldn't be happening

@ramezgerges
Copy link
Contributor

@nickrandolph We had trouble reproducing this when it was first opened. If you have an alternative repro, please post it as well, maybe it will be more reproducible.

@mcNets
Copy link
Contributor

mcNets commented Oct 22, 2024

@nickrandolph @ramezgerges Here another minimum example built with 5.4.10. I used mouse wheel to scroll the content.

UnoScrollArea.mp4

UnoScrollArea.zip

@ramezgerges
Copy link
Contributor

@mcNets Unfortunately, I still can't reproduce. (sidenote: I modified the uno.sdk version to 5.5.0-dev.90 because I already had it restored, but it won't matter.)

2024-10-22.19-53-10.mp4

Could you try setting the SkiaSharpVersion msbuild property to 3.0.0-preview.4.1? I discovered a few Linux-only skia bugs related to clipping a while ago and they were fixed in the skia version used in SkiaSharp 3. Maybe a similar bug is specific to your environment and is also fixed in SkiaSharp3.

@mcNets
Copy link
Contributor

mcNets commented Oct 22, 2024

@ramezgerges 👍

By adding <SkiaSharpVersion>3.0.0-preview.4.1</SkiaSharpVersion> to the project it works fine with 5.4.10 and 5.5.0-dev.90

@ramezgerges ramezgerges self-assigned this Oct 22, 2024
@agneszitte
Copy link
Contributor Author

@ramezgerges what is left to be done for this issue please?

@ramezgerges
Copy link
Contributor

@agneszitte What's left is moving Uno to SkiaSharp 3 :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/skia/composition ✏️ area/skia ✏️ Categorizes an issue or PR as relevant to Skia
Projects
None yet
Development

No branches or pull requests

5 participants