Search Issue Tracker
Duplicate
Votes
0
Found in
5.4.3f1
Issue ID
854715
Regression
No
[UI] [Slider] [MultiDisplay] Sliders do not work or act incorrectly on dual displays
To reproduce:
1) Open attached project and scene
2) Open two game tabs for Displays 1 and 2
3) Play it
4) Try both sliders - either Display 2 slider doesn't work or it instead slides first display's slider
5) Build and run on Standalone
6) Try both sliders again - now Display 2 slider reacts to hovering, but on first press it goes to max value and then cannot be moved at all
Expected: Each slider works independently
Reproduced in 5.4.3f1, 5.5.0f3, 5.6.0a5
Comments (2)
-
ahmidou
Apr 12, 2017 16:09
Hi,
Have this been merged in 5.6? I still have the problem.
Also can we have a 5.6 working branch for the UI repo?Thanks
-
jlsali
Jan 09, 2017 19:36
I´m solved this problem using "RelativeMouseAt" on "ScreenPointToLocalPointInRectangle". Like this:
// Update the slider's position based on the mouse.
void UpdateDrag(PointerEventData eventData, Camera cam)
{
RectTransform clickRect = m_HandleContainerRect ?? m_FillContainerRect;
if (clickRect != null && clickRect.rect.size[(int)axis] > 0)
{
Vector2 localCursor;
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(clickRect, Display.RelativeMouseAt(eventData.position), cam, out localCursor))
return;localCursor -= clickRect.rect.position;
float val = Mathf.Clamp01((localCursor - m_Offset)[(int)axis] / clickRect.rect.size[(int)axis]);
normalizedValue = (reverseValue ? 1f - val : val);
}
}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
- UI Builder doesn't update the style sheet when using "Extract inline style" right-click option
This is a duplicate of issue #834781