Skip to content

Commit 528d2f5

Browse files
authored
Merge pull request #486 from Csantucci/3DCabs-clamp-digitals-to-max-and-minvalue
Bug fix for https://bugs.launchpad.net/or/+bug/1943837 3D cabs: digitals aren't clamped against Max and MinValue
2 parents 634047d + 5ad960a commit 528d2f5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,6 +2618,7 @@ public string GetDigits(out Color DrawColor)
26182618
var digital = Control as CVCDigital;
26192619
string displayedText = "";
26202620
Num = Locomotive.GetDataOf(Control);
2621+
if (digital.MinValue < digital.MaxValue) Num = MathHelper.Clamp(Num, (float)digital.MinValue, (float)digital.MaxValue);
26212622
if (Math.Abs(Num) < digital.AccuracySwitch)
26222623
Format = Format2;
26232624
else

0 commit comments

Comments
 (0)