diff --git a/Leditor/Pages/Cameras.cs b/Leditor/Pages/Cameras.cs index e3fd8ae..5d8a66c 100644 --- a/Leditor/Pages/Cameras.cs +++ b/Leditor/Pages/Cameras.cs @@ -398,12 +398,18 @@ public override void Draw() { cam.Coords = draggedOrigin; } + + var q = cam.Quad; - Printers.DrawCameraSprite(cam.Coords, cam.Quad, _camera, c); + Printers.DrawCameraSprite(cam.Coords, ref q, _camera, c); + + cam.Quad = q; } else { - var (clicked, _) = Printers.DrawCameraSprite(cam.Coords, cam.Quad, _camera, c); + var q = cam.Quad; + var (clicked, _) = Printers.DrawCameraSprite(cam.Coords, ref q, _camera, c); + cam.Quad = q; if (clicked && !clickTracker) { diff --git a/Leditor/Printers.cs b/Leditor/Printers.cs index c6a771f..4e8031e 100644 --- a/Leditor/Printers.cs +++ b/Leditor/Printers.cs @@ -3487,7 +3487,7 @@ int layer /// two boolean values that signal whether the camera was click/dragged internal static (bool clicked, bool hovered) DrawCameraSprite( Vector2 origin, - Data.CameraQuad quad, + ref Data.CameraQuad quad, Camera2D camera, int index = 0) { @@ -3618,12 +3618,6 @@ internal static (bool clicked, bool hovered) DrawCameraSprite( Color.Red ); - // var quarter1 = new Rectangle(origin.X - 150, origin.Y - 150, GLOBALS.EditorCameraWidth / 2 + 150, GLOBALS.EditorCameraHeight / 2 + 150); - // var quarter2 = new Rectangle(GLOBALS.EditorCameraWidth / 2 + origin.X, origin.Y - 150, GLOBALS.EditorCameraWidth / 2 + 150, GLOBALS.EditorCameraHeight / 2 + 150); - // var quarter3 = new Rectangle(GLOBALS.EditorCameraWidth / 2 + origin.X, origin.Y + GLOBALS.EditorCameraHeight / 2, GLOBALS.EditorCameraWidth / 2 + 150, GLOBALS.EditorCameraHeight / 2 + 150); - // var quarter4 = new Rectangle(origin.X - 150 , GLOBALS.EditorCameraHeight / 2 + origin.Y, GLOBALS.EditorCameraWidth / 2 + 150, GLOBALS.EditorCameraHeight / 2 + 150); - - DrawLineV(topLeftV, topRightV, color); DrawLineV(topRightV, bottomRightV, color); DrawLineV(bottomRightV, bottomLeftV, color);