The source of the issue is differences between viewport resolution and screen resolution. Cursor position is reported w.r.t. screen space, but we need to map that value to the viewport to correctly test collision. For example, using 1080x1080f the viewport res is the expected 1080x1080. However the screen res for that setting could be 1280x960 (With some stretching done after the fact). To adjust for this we need scale the mouse position by the viewport res divided by the screen res (Ex: SWindow::GetSizeInScreen / SlateApplicationBase::CachedDisplayMetrics).
Expected: Clicking is pixel accurate, conforms to exact shape of actors / widgets. Can click & drag entire width of screen
Observed: Collisions are offset. Dragging is clipped to a region smaller than the entire screen.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-117869 in the post.
1 |
Component | UE - Editor - UI Systems - Slate |
---|---|
Affects Versions | 4.27 |
Target Fix | 5.0 |
Created | Jun 10, 2021 |
---|---|
Resolved | Jul 29, 2021 |
Updated | Dec 1, 2021 |