This PR makes scroll delta values reaching UI Toolkit as uniform as possible between different platforms and between editor or runtime. The standard used is that of the Windows Editor, i.e. the same text in an TextField should scroll by the same amount in an EditorWindow than in a runtime panel, with or without uGUI interoperability.
Since legacy input is still supported in Unity 6, we make the InputSystem match the scaling of the legacy input by default. However, we also introduce a new scrollDeltaPerTick property API to allow users to fall back on the scroll factor that we had in InputSystem package version <= 1.4, by setting it to a value of 6.
Testing
Manually tested the changes. Modified existing unit test and added one for the newly introduced API.
Risk
This PR yet again changes the scroll factor for existing user projects without any notification about it. Fortunately, they can very easily tweak it back to whatever they had, but this may still come as a surprise to them. On the other hand, the new setup is much much better for new projects, and for existing projects it's probably better too, allowing users to remove their workaround for the previously bad scroll factors.
Checklist
Before review:
[ ] Changelog entry added.
Explains the change in Changed, Fixed, Added sections.
For API change contains an example snippet and/or migration example.
JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
Description
Fixes ISXB-808. Based on recently landed trunk PR.
Details of what was changed and the thought process can be found in these Google Documents:
Changes made
This PR makes scroll delta values reaching UI Toolkit as uniform as possible between different platforms and between editor or runtime. The standard used is that of the Windows Editor, i.e. the same text in an TextField should scroll by the same amount in an EditorWindow than in a runtime panel, with or without uGUI interoperability.
Since legacy input is still supported in Unity 6, we make the InputSystem match the scaling of the legacy input by default. However, we also introduce a new
scrollDeltaPerTick
property API to allow users to fall back on the scroll factor that we had in InputSystem package version <= 1.4, by setting it to a value of6
.Testing
Manually tested the changes. Modified existing unit test and added one for the newly introduced API.
Risk
This PR yet again changes the scroll factor for existing user projects without any notification about it. Fortunately, they can very easily tweak it back to whatever they had, but this may still come as a surprise to them. On the other hand, the new setup is much much better for new projects, and for existing projects it's probably better too, allowing users to remove their workaround for the previously bad scroll factors.
Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: