Search Issue Tracker

By Design

Votes

0

Found in

2017.4.14f1

2019.1.0a8

Issue ID

1099572

Regression

No

[UI Elements] An object has a delay in the tracking when moving cursor quickly

UI Toolkit

-

How to reproduce:
1. Open attached "MoveMouse.zip" project
2. Go to Test -> "Mouse move"
3. Move the cursor quickly

Expected result: A point should be directly under the mouse
Actual result: A point has a delay in the tracking

Reproducible: 2019.1.0a13

Notes:
- Didn't test with previous versions, because UI Elements feature was experimental and it takes too long to change the code

  1. Resolution Note (2019.2.X):

    There is no desynchronization happening between the last event and the repaint (that can be verified with Debug.Log of the event position and the element resolved styles top/left inside a generateVisualContent callback). The issue seems to be a deeper level, where the editor has some specific logic to collapse mouse events to avoid invoking UI code at too high frequency. This effectively means that UI is capped at a specific frame rate which is below the speed at which mouse events come in.

    One interesting thing to try would be to read the mouse position at the last possible moment before rendering but unfortunately we lack such APIs in the editor. Saving the last seen value from input events will unfortunately not solve this as it will suffer the same delay.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.