Make scroll bar in options menu more accurate.

This commit is contained in:
Skyth 2025-02-09 00:29:40 +03:00
parent fcd1673cfc
commit 97b20742a3

View file

@ -1339,7 +1339,7 @@ static void DrawConfigOptions()
// Draw scroll bar
if (rowCount > visibleRowCount)
{
float totalHeight = (clipRectMax.y - clipRectMin.y);
float totalHeight = (clipRectMax.y - clipRectMin.y) - Scale(2.0f);
float heightRatio = float(visibleRowCount) / float(rowCount);
float offsetRatio = float(g_firstVisibleRowIndex) / float(rowCount);
@ -1351,7 +1351,7 @@ static void DrawConfigOptions()
drawList->AddRectFilled
(
{ clipRectMax.x, minY },
{ clipRectMax.x + gridSize, minY + totalHeight * heightRatio },
{ clipRectMax.x + gridSize - Scale(1.0f), minY + totalHeight * heightRatio},
IM_COL32(0, 128, 0, 255)
);
}