Skip to content

City bars: no stale bars after they are hidden - #166

Open
MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/city-bars-stale
Open

MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/city-bars-stale

Conversation

@MortenLyhr

Copy link
Copy Markdown
Contributor

Follow-up to the review of #145: #145 (comment)

MapView::drawOverlay cleared the city bars' rectangles only after its early return. While the city screen is up (or with banners or cities off, or on the globe) no bars are drawn, but cityBarAt still matched the rectangles from the last map frame. A click on the plots where a city's bar had been went to that city instead of the plot under the pointer. On the city screen that meant a click a couple of plots north of the city acted on the city plot instead of working that tile.

The rectangles are now cleared before the early return, so with no bars drawn there are none to click.

Also, as asked in the review of #145: two comments no longer describe earlier behaviour (the tilt curve in MapWindow::updatePitch, the river cells in MapView).

Checks

  • Scripted mouse (--keys, TestMap, Roma at 40,36, 1600×900): the camera on 40,33 puts Roma's bar at the top of the window; Roma's screen is opened and the pixels where the bar was are clicked. Before: plot 40,36 (the city) all three times. After: plot 40,38, the plot under the pointer.
  • ctest 15/15.
  • Checksum at turn 100 (--turns 100 --map Fractal --size STANDARD --seed 7): D7D43800, unchanged.
  • Note: Bundle 5/6: interface and popups #149 contains the same move of cityBars.clear(). Whichever merges second has a one-line conflict there; keep a single clear() at the top of drawOverlay.

🤖 Generated with Claude Code

drawOverlay cleared the city bars' rectangles only after its early return,
so on the city screen (or with the banners or cities off, or on the globe)
cityBarAt kept matching the bars of the last map frame: a click on the plots
where a city's bar had been went to the city instead of the plot under it.
The rectangles are now cleared before that return.

Also takes two notes of earlier behaviour out of comments (the tilt curve's
straight line, the river cells' old cost), as CONTRIBUTING asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant