Codechange: use int32_t instead of uint16_t for scroll bar position/size/capacity

(cherry picked from commit d09b5aaeba)

# Conflicts:
#	src/newgrf_debug_gui.cpp
#	src/newgrf_gui.cpp
#	src/widget_type.h
This commit is contained in:
Rubidium
2024-02-25 19:42:28 +01:00
committed by Jonathan G Rennison
parent 2219b8e378
commit 5d8e40cad4
17 changed files with 73 additions and 69 deletions

View File

@@ -699,13 +699,13 @@ private:
int GetInstructionFromPt(int y)
{
NWidgetBase *nwid = this->GetWidget<NWidgetBase>(PROGRAM_WIDGET_INSTRUCTION_LIST);
int sel = (y - nwid->pos_y - WidgetDimensions::scaled.framerect.top) / nwid->resize_y; // Selected line
int32_t sel = (y - nwid->pos_y - WidgetDimensions::scaled.framerect.top) / nwid->resize_y; // Selected line
if ((uint)sel >= this->vscroll->GetCapacity()) return -1;
if (sel >= this->vscroll->GetCapacity()) return -1;
sel += this->vscroll->GetPosition();
return (sel <= int(this->instructions.size()) && sel >= 0) ? sel : -1;
return (sel <= (int32_t)(this->instructions.size()) && sel >= 0) ? sel : -1;
}
void RebuildInstructionList()