Skip to content

Commit

Permalink
Fix #12202: Race condition when using sprite picker. (#12204)
Browse files Browse the repository at this point in the history
When using the sprite picker the screen is redrawn so that the sprites under the mouse cursor can be captured. This redraw also caused the sprite aligner window to be redrawn before the OnInvalidateData event that updates its scrollbars with the list count.
  • Loading branch information
PeterN authored Mar 1, 2024
1 parent 3fd5c33 commit a602845
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/newgrf_debug_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,9 @@ struct SpriteAlignerWindow : Window {
}

case WID_SA_LIST: {
/* Don't redraw sprite list while it is still being filled by picker. */
if (_newgrf_debug_sprite_picker.mode == SPM_REDRAW) break;

const NWidgetBase *nwid = this->GetWidget<NWidgetBase>(widget);
int step_size = nwid->resize_y;

Expand Down

0 comments on commit a602845

Please sign in to comment.