Skip to content

Commit

Permalink
Fixed cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryMarkle committed Sep 9, 2024
1 parent 4d93ec0 commit 09e9823
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 8 additions & 2 deletions Leditor/Pages/Cameras.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
8 changes: 1 addition & 7 deletions Leditor/Printers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3487,7 +3487,7 @@ int layer
/// <returns>two boolean values that signal whether the camera was click/dragged</returns>
internal static (bool clicked, bool hovered) DrawCameraSprite(
Vector2 origin,
Data.CameraQuad quad,
ref Data.CameraQuad quad,
Camera2D camera,
int index = 0)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 09e9823

Please sign in to comment.