From 1c8a32b8dc57548d536b2eccd0e5ae04243deb6f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 2 Nov 2019 14:56:16 +0100 Subject: [PATCH] removed the rectanglef extension since we have our own now --- MLEM.Extended/Extensions/CameraExtensions.cs | 14 -------------- MLEM/Cameras/Camera.cs | 6 ++++++ 2 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 MLEM.Extended/Extensions/CameraExtensions.cs diff --git a/MLEM.Extended/Extensions/CameraExtensions.cs b/MLEM.Extended/Extensions/CameraExtensions.cs deleted file mode 100644 index 22252cc..0000000 --- a/MLEM.Extended/Extensions/CameraExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Xna.Framework; -using MonoGame.Extended; -using Camera = MLEM.Cameras.Camera; - -namespace MLEM.Extended.Extensions { - public static class CameraExtensions { - - public static RectangleF GetVisibleRectangle(this Camera camera) { - var start = camera.ToWorldPos(Vector2.Zero); - return new RectangleF(start, camera.ToWorldPos(new Vector2(camera.Viewport.Width, camera.Viewport.Height)) - start); - } - - } -} \ No newline at end of file diff --git a/MLEM/Cameras/Camera.cs b/MLEM/Cameras/Camera.cs index 71c667e..0600c51 100644 --- a/MLEM/Cameras/Camera.cs +++ b/MLEM/Cameras/Camera.cs @@ -2,6 +2,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Extensions; +using MLEM.Misc; namespace MLEM.Cameras { public class Camera { @@ -58,6 +59,11 @@ namespace MLEM.Cameras { return (this.ToWorldPos(Vector2.Zero), this.ToWorldPos(new Vector2(this.Viewport.Width, this.Viewport.Height))); } + public RectangleF GetVisibleRectangle() { + var start = this.ToWorldPos(Vector2.Zero); + return new RectangleF(start, this.ToWorldPos(new Vector2(this.Viewport.Width, this.Viewport.Height)) - start); + } + public void ConstrainWorldBounds(Vector2 min, Vector2 max) { if (this.Position.X < min.X) this.Position.X = min.X;