Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] TouchBehavior scaling causes flickering

Open MitchBomcanhao opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

  • [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior

When you add a feature like HoverScale="0.5", placing your mouse cursor over the control will resize it accordingly. However, if as a result of the scaling the cursor is now seen as outside the area of the then-scaled control, the scaling is then reset to 1 automatically. once that happens, the cursor will again be in over the control, so it'll scale it down to 0.5 again. rinse, repeat.

Expected Behavior

Not entirely sure how to describe the correct behavior, but it shouldn't really trip over itself when applying scaling when hovering.

Steps To Reproduce

  1. Create a control with a TouchBehavior, preferably a large control that takes a good chunk of the screen size like shown below:
<VerticalStackLayout Padding="30,0" Spacing="25">
        <Label
            BackgroundColor="orange"
            HeightRequest="300"
            HorizontalOptions="Fill"
            Text="hover this">
            <Label.Behaviors>
                <toolkit:TouchBehavior HoveredScale="0.5" />
            </Label.Behaviors>
        </Label>
    </VerticalStackLayout>
  1. run the app and hover the mouse close to the edge of the control, so that when it scales down the mouse cursor will no longer be over the top of the scaled control.
  2. observe the control repeatedly going into the two scaled states.

Link to public reproduction project repository

https://github.com/MitchBomcanhao/Maui sorry, I don't have a proper repro project as it is a very basic scenario. linked to a fork of the toolkit repository in order to be able to raise this report. the bug report form mentions we need a project link Otherwise the issue will be marked with "Needs reproduction" label and will have a lower priority. Attached zip files cannot be opened by us. which is untrue - if we don't have a link we can't even submit the report.

Environment

- .NET MAUI CommunityToolkit:8.0.1
- OS: Windows 10.0.19045.4170
- .NET MAUI: 8.0.14

Anything else?

Here is a screen recording HoverScaleFlicker 2024-04-05 09-38-13

MitchBomcanhao avatar Apr 05 '24 08:04 MitchBomcanhao

I've reproduced this on Windows but unsure if the same will happen on other platforms when using a pointer user interface. Don't have any to test with.

MitchBomcanhao avatar Apr 05 '24 08:04 MitchBomcanhao

Can you provide a screen recording of this issue please? ScreenToGif is a good tool and it will help document this issue since there isn't a reproduction

Axemasta avatar Apr 05 '24 08:04 Axemasta

@Axemasta I've updated the entry with a screen recording and the xaml for my sample UI

MitchBomcanhao avatar Apr 05 '24 08:04 MitchBomcanhao

if you move the mouse cursor over the label text, it flickers in and out very quickly. if you leave it there, it'll scale up and down at regular intervals.

MitchBomcanhao avatar Apr 05 '24 08:04 MitchBomcanhao