Skip to content

Commit 7aafe02

Browse files
Fix for sometimes throttle reacted wrong, direction change
1 parent a3c907f commit 7aafe02

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,15 +2051,7 @@ public CabViewDiscreteRenderer(Viewer viewer, MSTSLocomotive locomotive, CVCWith
20512051
default:
20522052
ChangedValue = (value) =>
20532053
{
2054-
if (UserInput.IsMouseLeftButtonDown)
2055-
{
2056-
return value + NormalizedMouseMovement();
2057-
}
2058-
else
2059-
{
2060-
// mousewheel
2061-
return value + (float)UserInput.MouseWheelChange / 1500;
2062-
}
2054+
return value + NormalizedMouseMovement();
20632055
};
20642056
break;
20652057
}
@@ -2374,8 +2366,8 @@ float NormalizedMouseMovement()
23742366
{
23752367
// mousewheel
23762368
return (ControlDiscrete.Orientation > 0
2377-
? (float)UserInput.MouseWheelChange / (float)Control.Height
2378-
: (float)UserInput.MouseWheelChange / (float)Control.Width)
2369+
? (float)UserInput.MouseWheelChange / (float)1500
2370+
: (float)UserInput.MouseWheelChange / (float)1500)
23792371
* (ControlDiscrete.Direction > 0 ? -1 : 1);
23802372
}
23812373
}

0 commit comments

Comments
 (0)