Skip to content

Respect brush size when painting terrain lines - #346

Draft
keysmon wants to merge 2 commits into
CnCNet:masterfrom
keysmon:fix/334-line-brush-size
Draft

keysmon wants to merge 2 commits into
CnCNet:masterfrom
keysmon:fix/334-line-brush-size

Conversation

@keysmon

@keysmon keysmon commented Oct 21, 2026

Copy link
Copy Markdown

Fixes #334.

Shift-line terrain painting currently ignores the selected brush size. This applies the brush at each line anchor using whole-tile offsets, and keeps the original brush settings for redo. Short and zero-length previews use the placement mutation so their footprint matches the brush. Adjusted endpoint handling also allows short multi-cell strokes to commit correctly.

Height-changing placement and previews now refresh cell lighting. Final review caught stale brightness in the short-preview path; nine regression cases reproduced it before the correction.

Validation

  • 65 tests passed: 36 editor regression cases and 29 existing MCP cases. Brush and lighting regressions were verified failing before their fixes.
  • 2,112 headless cursor/mutation scenarios passed across TS and YR cell settings, covering brush sizes, multi-cell/sparse tiles, eight directions, AutoLAT, boundaries, preview cleanup and undo/redo. These use synthetic map/TMP data through the real handlers.
  • @keysmon checked the original and fixed brush behavior through CrossOver on macOS: 3x3/5x5 sand strokes, AutoLAT previews, multi-cell road placement and undo/redo, including redo after changing brush size. Those GUI checks precede the master rebase and lighting follow-up; automated checks were rerun afterward.

Native Windows verification is still outstanding. Local editor/test builds passed with content compilation disabled. The full solution has an inherited missing external Rampastring.Updater dependency that also fails on pristine source. Keeping this as a draft for review and Windows validation.

Screenshots

With a 3x3 brush selected, the original Shift stroke remains one tile wide:

Original 3x3 brush produces a one-tile-wide line

The fixed 3x3 stroke uses the brush width:

Fixed 3x3 terrain line

A 5x5 brush produces a wider stroke:

Fixed 5x5 terrain line with AutoLAT

Implementation, automated tests and this PR description were prepared with Codex assistance. Manual observations and screenshots are from @keysmon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Holding shift to draw a straight line always paints 1 tile regardless of paintbrush size

1 participant