MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Item_ListBox_MaxScroll

Function Item_ListBox_MaxScroll

code/ui/ui_shared.cpp:8885–8905  ·  view source on GitHub ↗

================= Item_ListBox_MaxScroll ================= */

Source from the content-addressed store, hash-verified

8883=================
8884*/
8885int Item_ListBox_MaxScroll(itemDef_t *item)
8886{
8887 listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData;
8888 int count = DC->feederCount(item->special);
8889 int max;
8890
8891 if (item->window.flags & WINDOW_HORIZONTAL)
8892 {
8893 max = count - (item->window.rect.w / listPtr->elementWidth) + 1;
8894 }
8895 else
8896 {
8897 max = count - (item->window.rect.h / listPtr->elementHeight) + 1;
8898 }
8899
8900 if (max < 0)
8901 {
8902 return 0;
8903 }
8904 return max;
8905}
8906
8907/*
8908=================

Callers 4

Item_ListBox_PaintFunction · 0.70
Item_ListBox_HandleKeyFunction · 0.70
Scroll_ListBox_ThumbFuncFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected