Skip to content

Commit

Permalink
Fix bug where waypoints and base nodes outside of the camera were not…
Browse files Browse the repository at this point in the history
… visible on the minimap or megamap
  • Loading branch information
Rampastring committed Dec 21, 2024
1 parent 594a429 commit cc6e8d0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/TSMapEditor/Rendering/MapView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cc6e8d0

Please sign in to comment.