mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-10-31 21:00:51 +01:00
fixed camera's ConstrainWorldBounds midpoint formula being incorrect
This commit is contained in:
parent
b237c0fcc4
commit
62c8b7766c
1 changed files with 2 additions and 2 deletions
|
@ -135,7 +135,7 @@ namespace MLEM.Cameras {
|
|||
var lastPos = this.Position;
|
||||
var visible = this.GetVisibleRectangle();
|
||||
if (max.X - min.X < visible.Width) {
|
||||
this.LookingPosition = new Vector2((max.X - min.X) / 2, this.LookingPosition.Y);
|
||||
this.LookingPosition = new Vector2((max.X + min.X) / 2, this.LookingPosition.Y);
|
||||
} else {
|
||||
if (this.Position.X < min.X)
|
||||
this.Position.X = min.X;
|
||||
|
@ -144,7 +144,7 @@ namespace MLEM.Cameras {
|
|||
}
|
||||
|
||||
if (max.Y - min.Y < visible.Height) {
|
||||
this.LookingPosition = new Vector2(this.LookingPosition.X, (max.Y - min.Y) / 2);
|
||||
this.LookingPosition = new Vector2(this.LookingPosition.X, (max.Y + min.Y) / 2);
|
||||
} else {
|
||||
if (this.Position.Y < min.Y)
|
||||
this.Position.Y = min.Y;
|
||||
|
|
Loading…
Reference in a new issue