diff --git a/src/TSMapEditor/Rendering/MapView.cs b/src/TSMapEditor/Rendering/MapView.cs index ffd18228..f4997ddc 100644 --- a/src/TSMapEditor/Rendering/MapView.cs +++ b/src/TSMapEditor/Rendering/MapView.cs @@ -1614,10 +1614,9 @@ private static void DrawArrow(Vector2 start, Vector2 end, public void Draw(bool isActive, TechnoBase technoUnderCursor, MapTile tileUnderCursor, CursorAction cursorAction) { - if (isActive && tileUnderCursor != null && cursorAction != null) - { - cursorAction.PreMapDraw(tileUnderCursor.CoordsToPoint()); - } + // Note: the cursor action's PreMapDraw is invoked by MapUI.Draw before this method, + // so that TechnoUnderCursor assignments made by placement previews are + // visible to DrawPerFrameTransparentElements below. if (mapInvalidated || cameraMoved) { diff --git a/src/TSMapEditor/UI/MapUI.cs b/src/TSMapEditor/UI/MapUI.cs index 0eee7641..05dce647 100644 --- a/src/TSMapEditor/UI/MapUI.cs +++ b/src/TSMapEditor/UI/MapUI.cs @@ -742,6 +742,12 @@ public void DeleteObjectFromCell(Point2D cellCoords) public override void Draw(GameTime gameTime) { + // Run the cursor action's pre-map-draw logic before passing TechnoUnderCursor + // to the renderer, so that placement previews (which assign TechnoUnderCursor) + // get their range indicators drawn during placement. + if (IsActive && tileUnderCursor != null && CursorAction != null) + CursorAction.PreMapDraw(tileUnderCursor.CoordsToPoint()); + mapView.Draw(IsActive, TechnoUnderCursor, tileUnderCursor, CursorAction); mapView.DrawOnTileUnderCursor(tileUnderCursor, CursorAction, isDraggingObject,