Skip to content

Commit fb1f454

Browse files
committed
Adjust combined control display
1 parent 8745029 commit fb1f454

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,16 +2160,17 @@ public virtual int GetDrawIndex()
21602160
case CABViewControlTypes.CPH_DISPLAY:
21612161
case CABViewControlTypes.CP_HANDLE:
21622162
var combinedHandlePosition = Locomotive.GetCombinedHandleValue(false);
2163-
index = PercentToIndex(combinedHandlePosition);
21642163
// Make sure any deviation from the split position gives a different index
21652164
int handleRelativePos = combinedHandlePosition.CompareTo(Locomotive.CombinedControlSplitPosition);
21662165
if (handleRelativePos != 0)
21672166
{
21682167
if (handleRelativePos == (ControlDiscrete.Reversed ? - 1 : 1))
2169-
index = Math.Max(index, SplitIndex + 1);
2168+
index = Math.Max(PercentToIndex(combinedHandlePosition), SplitIndex + 1);
21702169
else
2171-
index = Math.Min(index, SplitIndex - 1);
2170+
index = Math.Min(PercentToIndex(combinedHandlePosition), SplitIndex - 1);
21722171
}
2172+
else
2173+
index = SplitIndex;
21732174
break;
21742175
case CABViewControlTypes.ORTS_SELECTED_SPEED_DISPLAY:
21752176
if (Locomotive.CruiseControl == null)

0 commit comments

Comments
 (0)