mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-01 05:10:50 +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 lastPos = this.Position;
|
||||||
var visible = this.GetVisibleRectangle();
|
var visible = this.GetVisibleRectangle();
|
||||||
if (max.X - min.X < visible.Width) {
|
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 {
|
} else {
|
||||||
if (this.Position.X < min.X)
|
if (this.Position.X < min.X)
|
||||||
this.Position.X = min.X;
|
this.Position.X = min.X;
|
||||||
|
@ -144,7 +144,7 @@ namespace MLEM.Cameras {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max.Y - min.Y < visible.Height) {
|
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 {
|
} else {
|
||||||
if (this.Position.Y < min.Y)
|
if (this.Position.Y < min.Y)
|
||||||
this.Position.Y = min.Y;
|
this.Position.Y = min.Y;
|
||||||
|
|
Loading…
Reference in a new issue