From cc6e8d0351614ec3ae7ad5a7006f4fa45e92b02f Mon Sep 17 00:00:00 2001 From: Rampastring Date: Sat, 21 Dec 2024 14:58:18 +0200 Subject: [PATCH] Fix bug where waypoints and base nodes outside of the camera were not visible on the minimap or megamap --- src/TSMapEditor/Rendering/MapView.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/TSMapEditor/Rendering/MapView.cs b/src/TSMapEditor/Rendering/MapView.cs index 668579e0..c739355f 100644 --- a/src/TSMapEditor/Rendering/MapView.cs +++ b/src/TSMapEditor/Rendering/MapView.cs @@ -969,8 +969,9 @@ private void DrawBaseNode(GraphicalBaseNode graphicalBaseNode) // Base nodes can be large, let's increase the level of padding for them. int padding = Constants.RenderPixelPadding * 2; - if (Camera.TopLeftPoint.X > drawPoint.X + padding || Camera.TopLeftPoint.Y > drawPoint.Y + padding || - GetCameraRightXCoord() < drawPoint.X - padding || GetCameraBottomYCoord() < drawPoint.Y - padding) + if (MinimapUsers.Count == 0 && + (Camera.TopLeftPoint.X > drawPoint.X + padding || Camera.TopLeftPoint.Y > drawPoint.Y + padding || + GetCameraRightXCoord() < drawPoint.X - padding || GetCameraBottomYCoord() < drawPoint.Y - padding)) { return; } @@ -1069,10 +1070,11 @@ private void DrawWaypoint(Waypoint waypoint) if (cell != null && !EditorState.Is2DMode) drawPoint -= new Point2D(0, cell.Level * Constants.CellHeight); - if (Camera.TopLeftPoint.X > drawPoint.X + EditorGraphics.TileBorderTexture.Width || + if (MinimapUsers.Count == 0 && + (Camera.TopLeftPoint.X > drawPoint.X + EditorGraphics.TileBorderTexture.Width || Camera.TopLeftPoint.Y > drawPoint.Y + EditorGraphics.TileBorderTexture.Height || GetCameraRightXCoord() < drawPoint.X || - GetCameraBottomYCoord() < drawPoint.Y) + GetCameraBottomYCoord() < drawPoint.Y)) { // This waypoint is outside the camera return;