Fix: wheel over UI scrolls the list instead of zooming the camera
The orbit rig read the wheel unfiltered for zoom, so scrolling a paint-mode scroll list also zoomed the camera. Gate the zoom behind a shared InputUtil.PointerOverUi() helper (EventSystem raycast); MeshPainter's private IsPointerOverUi() now delegates to the same helper (DRY). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
a4604328d2
commit
50efc7e8b3
3 files changed
+18
-11
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
using UnityEngine.InputSystem;
|
||||
#endif
|
||||
@@ -40,6 +41,15 @@ public static class InputUtil
|
||||
Cursor.visible = !locked;
|
||||
}
|
||||
|
||||
/// <summary>True while the pointer is over an interactive UI element (a raycast target), so the
|
||||
/// wheel/click belongs to the UI (e.g. a scroll list) and must not also zoom the camera or paint
|
||||
/// the mesh behind it. False when no EventSystem exists.</summary>
|
||||
public static bool PointerOverUi()
|
||||
{
|
||||
var es = EventSystem.current;
|
||||
return es && es.IsPointerOverGameObject();
|
||||
}
|
||||
|
||||
public static bool ShiftHeld()
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
|
||||
Reference in new issue
Block a user