Fix: allow wheel zoom while sprinting (Shift)
The orbit camera suppressed wheel zoom whenever Shift/Ctrl was held, to reserve Shift/Ctrl+wheel for the paint brush resize. But Shift is also the sprint key, so sprinting blocked zoom outside paint mode. Gate the reservation on PanEnabled (set only by PaintMode.Enter/Exit), so the wheel is only claimed for brush resize while actually in paint mode; otherwise it zooms normally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
0d14980a76
commit
d867452dcb
1 file changed
+5
-3
@@ -238,9 +238,11 @@ public class ThirdPersonOrbitInput : MonoBehaviour
|
|||||||
|
|
||||||
float scale = CurrentScale();
|
float scale = CurrentScale();
|
||||||
|
|
||||||
// Shift/Ctrl+wheel is reserved for the paint brush resize (MeshPainter), so the orbit camera
|
// Shift/Ctrl+wheel is reserved for the paint brush resize (MeshPainter) - but only in paint
|
||||||
// ignores the wheel while either is held - otherwise it would zoom and resize at once.
|
// mode (PanEnabled), where the resize actually claims the wheel. Outside paint mode Shift is
|
||||||
float scroll = (InputUtil.ShiftHeld() || InputUtil.CtrlHeld()) ? 0f : InputUtil.ReadScroll();
|
// the sprint key, so the wheel must still zoom.
|
||||||
|
bool brushResizeClaimsWheel = PanEnabled && (InputUtil.ShiftHeld() || InputUtil.CtrlHeld());
|
||||||
|
float scroll = brushResizeClaimsWheel ? 0f : InputUtil.ReadScroll();
|
||||||
if (!Mathf.Approximately(scroll, 0f))
|
if (!Mathf.Approximately(scroll, 0f))
|
||||||
{
|
{
|
||||||
// One wheel notch = one zoom step (sign only, platform-independent). The step scales with
|
// One wheel notch = one zoom step (sign only, platform-independent). The step scales with
|
||||||
|
|||||||
Reference in new issue
Block a user