Shift-drag draws a line for belts and other transport pieces

Belts, filters, screw conveyors, shafts and pipe pieces never fill a rectangle;
a diagonal belt drag stays sloped with Shift held.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 23:27:06 -04:00
co-authored by Claude Opus 5.5
parent 664e086969
commit 18528a7f73
10 changed files with 36 additions and 12 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ function drawPreviews() {
if (P.kind === 'block') {
const v = pieceV(P);
col = previewColor(code, v);
cells = GAME.drag ? (modShift() ? blockRect(GAME.drag.bx, GAME.drag.by, b.bx, b.by) : blockLine(GAME.drag.bx, GAME.drag.by, b.bx, b.by, isWall(code) || isSlopeBelt(code) || code === BP_SCREW)) : [[b.bx, b.by]];
cells = GAME.drag ? (modShift() && !lineOnly(code) ? blockRect(GAME.drag.bx, GAME.drag.by, b.bx, b.by) : blockLine(GAME.drag.bx, GAME.drag.by, b.bx, b.by, isWall(code) || isSlopeBelt(code) || code === BP_SCREW)) : [[b.bx, b.by]];
const dd = GAME.drag ? dragDirFor(P, GAME.drag, b) : -1;
if (dd !== GAME.dragDir) { GAME.dragDir = dd; hudDirty = true; }
const dIdx = dd >= 0 ? dd : (GAME.pieceDir[P.id] || 0);