Skip to content

Commit

Permalink
Fix: Improve sprite aligner list size and alignment.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterN committed Dec 17, 2022
1 parent dcd6cc8 commit 03cc050
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/newgrf_debug_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,8 @@ struct SpriteAlignerWindow : Window {
size->height = ScaleGUITrad(200);
break;
case WID_SA_LIST:
SetDParamMaxDigits(0, 6);
size->width = GetStringBoundingBox(STR_BLACK_COMMA).width + padding.width;
resize->height = FONT_HEIGHT_NORMAL + padding.height;
resize->width = 1;
fill->height = resize->height;
Expand Down Expand Up @@ -914,7 +916,7 @@ struct SpriteAlignerWindow : Window {
std::vector<SpriteID> &list = _newgrf_debug_sprite_picker.sprites;
int max = std::min<int>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (uint)list.size());

Rect ir = r.Shrink(WidgetDimensions::scaled.framerect);
Rect ir = r.Shrink(WidgetDimensions::scaled.matrix);
for (int i = this->vscroll->GetPosition(); i < max; i++) {
SetDParam(0, list[i]);
DrawString(ir, STR_BLACK_COMMA, TC_FROMSTRING, SA_RIGHT | SA_FORCE);
Expand Down

0 comments on commit 03cc050

Please sign in to comment.