Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions SpriteFactory/Sprites/SpriteEditorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,21 @@ public override void Draw(GameTime gameTime)
_spriteBatch.End();
}
}

public override void OnSizeChanged(int width, int height)
{
base.OnSizeChanged(width, height);

//Resize the viewport with the window.
GraphicsDevice.Viewport = new Viewport(0, 0, width, height);
Vector2 lookLocation = Vector2.Zero;
if (Texture != null)
{
lookLocation.X += Texture.Width / 2f;
lookLocation.Y += Texture.Height / 2f;
}

Camera.LookAt(lookLocation);
}
}
}