Skip to content

Commit

Permalink
Automatic merge of T1.5.1-553-g4b9199858 and 13 pull requests
Browse files Browse the repository at this point in the history
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #853 at d05f581: Notify out of focus
- Pull request #855 at b39e5d8: Adds new route from TrainSimulations
- Pull request #857 at 9afc8c3: Adding Air Flow Meters
- Pull request #859 at fff2560: Steam adhesion bug#1
- Pull request #860 at d2b8a52: Changes in the Car Operations Menu for the lines with brake information
- Pull request #862 at 489f261: Fix engine leak problem
- Pull request #863 at a34b857: Alternate preset 3D cabviewpoints
- Pull request #864 at 2fed4b9: Fixes for Undesired Emergency Applications
- Pull request #865 at 705126e: Dispatcher window improvements
  • Loading branch information
openrails-bot committed Aug 25, 2023
15 parents 4b97ee5 + 4b91998 + 98dd1a7 + 61bbf43 + d00beb9 + 410a585 + d05f581 + b39e5d8 + 9afc8c3 + fff2560 + d2b8a52 + 489f261 + a34b857 + 2fed4b9 + 705126e commit 89c91ae
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions Source/RunActivity/Viewer3D/Popups/OutOfFocusWindow.cs
Expand Up @@ -34,31 +34,28 @@ public class OutOfFocusWindow : Window
private readonly int Thickness = 3;
private readonly Color Color = Color.Red;

private readonly int Width;
private readonly int Height;

public OutOfFocusWindow(WindowManager owner) : base(owner)
{
Line = new Texture2D(owner.Viewer.GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
Line = new Texture2D(Owner.Viewer.GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
Line.SetData(new[] { Color });

Width = owner.Viewer.GraphicsDevice.Viewport.Width;
Height = owner.Viewer.GraphicsDevice.Viewport.Height;
}

public override void Draw(SpriteBatch spriteBatch)
{
int width = Owner.Viewer.GraphicsDevice.Viewport.Width;
int height = Owner.Viewer.GraphicsDevice.Viewport.Height;

// top
DrawLine(spriteBatch, 0, 0, Width, Thickness, 0);
DrawLine(spriteBatch, 0, 0, width, Thickness, 0);

// bottom
DrawLine(spriteBatch, 0, Height - Thickness, Width, Thickness, 0);
DrawLine(spriteBatch, 0, height - Thickness, width, Thickness, 0);

// left
DrawLine(spriteBatch, Thickness, Thickness, Height, Thickness, 90);
DrawLine(spriteBatch, Thickness, Thickness, height, Thickness, 90);

// right
DrawLine(spriteBatch, Width, Thickness, Height, Thickness, 90);
DrawLine(spriteBatch, width, Thickness, height, Thickness, 90);
}

private void DrawLine(SpriteBatch spriteBatch, int X, int Y, int width, int height, int degrees)
Expand Down

0 comments on commit 89c91ae

Please sign in to comment.