Skip to content

fix: Avoid jumpy ScrollViewer visibility on Skia by avoiding rounding errors in ScrollViewer - #7544

Merged
jeromelaban merged 1 commit into
unoplatform:masterfrom
MartinZikmund:dev/mazi/skia-scrollviewer-jumpyt
Nov 28, 2021
Merged

jeromelaban merged 1 commit into
unoplatform:masterfrom
MartinZikmund:dev/mazi/skia-scrollviewer-jumpyt

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue (If applicable): closes #7514

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

In Skia the ScrollViewer ExtentHeight and ExtentWidth are based on the ActualHeight and ActualWidth value of a child. For TextBlock there is a special case where these values match the DesiredSize, which may can contain values with rounding errors (e.g. 18.0013324). This then causes issues for TextBox for example, as ExtentHeight - ViewPortHeight will resurt in a very small number like 0.0013324, which is however enough to make the ScrollBar visibility toggle between Collapsed and Visible and it can happen repeatedly.

What is the new behavior?

We check whether the Extent - Viewport subtraction actually yields a significant value, otherwise we just zero it out.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@MartinZikmund
MartinZikmund requested a review from a team November 26, 2021 22:38
@gitpod-io

gitpod-io Bot commented Nov 26, 2021

Copy link
Copy Markdown

@MartinZikmund MartinZikmund self-assigned this Nov 26, 2021
@robloo

robloo commented Nov 28, 2021

Copy link
Copy Markdown
Contributor

I've seen this issue before and had no idea how to approach it. During scrolling some child elements would just start jumping around +/- 1 pixel in size. Great work on tracking this down and finding a fix!

@jeromelaban
jeromelaban merged commit 93f22b1 into unoplatform:master Nov 28, 2021
@MartinZikmund MartinZikmund mentioned this pull request Apr 26, 2023
5 of 6 tasks
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.

[Skia] TextBox flicker on focus with Material/Fluent v2 styles

4 participants