@@ -1445,15 +1445,15 @@ void HandleUserInput(ElapsedTime elapsedTime)
14451445 && controlRenderer is ICabViewMouseControlRenderer mouseRenderer && mouseRenderer . IsMouseWithin ( )
14461446 && ( controlRenderer . Control . Screens == null || controlRenderer . Control . Screens . Count == 0 || controlRenderer . Control . Screens [ 0 ] == "all"
14471447 || controlRenderer . Control . Screens . Contains ( locoViewer . _CabRenderer . ActiveScreen [ controlRenderer . Control . Display ] ) ) )
1448- {
1449- if ( UserInput . IsMouseLeftButtonPressed )
1448+ {
1449+ if ( UserInput . IsMouseLeftButtonPressed )
14501450 MouseChangingControl = mouseRenderer ;
14511451 else if ( MouseChangingControl == null && RenderProcess . IsMouseVisible )
1452- MousePickedControl = mouseRenderer ;
1453- break ;
1454- }
1455- }
1456- }
1452+ MousePickedControl = mouseRenderer ;
1453+ break ;
1454+ }
1455+ }
1456+ }
14571457 else if ( Camera is ThreeDimCabCamera && locoViewer . _has3DCabRenderer )
14581458 {
14591459 var trainCarShape = locoViewer . ThreeDimentionCabViewer . TrainCarShape ;
@@ -1466,31 +1466,31 @@ void HandleUserInput(ElapsedTime elapsedTime)
14661466 controlRenderer . Control . Screens . Contains ( locoViewer . ThreeDimentionCabRenderer . ActiveScreen [ controlRenderer . Control . Display ] ) ) )
14671467 {
14681468 foreach ( var targetNode in animatedPart . MatrixIndexes )
1469- {
1469+ {
14701470 if ( ! trainCarShape . SharedShape . StoredResultMatrixes . TryGetValue ( targetNode , out var matrix ) )
1471- continue ;
1472- var matrixWorldLocation = trainCarShape . Location . WorldLocation ;
1473- matrixWorldLocation . Location . X = matrix . Translation . X ;
1474- matrixWorldLocation . Location . Y = matrix . Translation . Y ;
1475- matrixWorldLocation . Location . Z = - matrix . Translation . Z ;
1476- Vector3 xnaCenter = Camera . XnaLocation ( matrixWorldLocation ) ;
1477- float d = ORTSMath . LineSegmentDistanceSq ( xnaCenter , NearPoint , FarPoint ) ;
1478- if ( bestD > d )
1479- {
1480- bestD = d ;
1471+ continue ;
1472+ var matrixWorldLocation = trainCarShape . Location . WorldLocation ;
1473+ matrixWorldLocation . Location . X = matrix . Translation . X ;
1474+ matrixWorldLocation . Location . Y = matrix . Translation . Y ;
1475+ matrixWorldLocation . Location . Z = - matrix . Translation . Z ;
1476+ Vector3 xnaCenter = Camera . XnaLocation ( matrixWorldLocation ) ;
1477+ float d = ORTSMath . LineSegmentDistanceSq ( xnaCenter , NearPoint , FarPoint ) ;
1478+ if ( bestD > d )
1479+ {
1480+ bestD = d ;
14811481 if ( UserInput . IsMouseLeftButtonPressed )
14821482 MouseChangingControl = mouseRenderer ;
14831483 else if ( MouseChangingControl == null && RenderProcess . IsMouseVisible )
14841484 MousePickedControl = mouseRenderer ;
1485- }
14861485 }
14871486 }
14881487 }
14891488 }
1489+ }
14901490 else
1491- {
1492- ActualCursor = Cursors . Default ;
1493- }
1491+ {
1492+ ActualCursor = Cursors . Default ;
1493+ }
14941494 }
14951495
14961496 if ( MousePickedControl != null & MousePickedControl != OldMousePickedControl )
@@ -1501,8 +1501,8 @@ void HandleUserInput(ElapsedTime elapsedTime)
15011501 if ( UserInput . IsMouseWheelChanged )
15021502 MousePickedControl ? . HandleUserInput ( ) ;
15031503
1504- OldMousePickedControl = MousePickedControl ;
1505- MousePickedControl = null ;
1504+ OldMousePickedControl = MousePickedControl ;
1505+ MousePickedControl = null ;
15061506
15071507 MouseChangingControl ? . HandleUserInput ( ) ;
15081508 if ( UserInput . IsMouseLeftButtonReleased )
0 commit comments