mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 14:38:34 +01:00
made constrainworldbounds return if it constrained
This commit is contained in:
parent
937b1757fe
commit
f4db1be464
1 changed files with 3 additions and 1 deletions
|
@ -70,7 +70,8 @@ namespace MLEM.Cameras {
|
|||
return new RectangleF(start, this.ToWorldPos(new Vector2(this.Viewport.Width, this.Viewport.Height)) - start);
|
||||
}
|
||||
|
||||
public void ConstrainWorldBounds(Vector2 min, Vector2 max) {
|
||||
public bool ConstrainWorldBounds(Vector2 min, Vector2 max) {
|
||||
var lastPos = this.Position;
|
||||
if (this.Position.X < min.X && this.Max.X > max.X) {
|
||||
this.LookingPosition = new Vector2((max.X - min.X) / 2, this.LookingPosition.Y);
|
||||
} else {
|
||||
|
@ -88,6 +89,7 @@ namespace MLEM.Cameras {
|
|||
if (this.Max.Y > max.Y)
|
||||
this.Max = new Vector2(this.Max.X, max.Y);
|
||||
}
|
||||
return !this.Position.Equals(lastPos, 0.001F);
|
||||
}
|
||||
|
||||
public void Zoom(float delta, Vector2? zoomCenter = null) {
|
||||
|
|
Loading…
Reference in a new issue