Line-based scrollbars #77

Open
opened 2026-04-25 18:34:32 +00:00 by abart27 · 0 comments
abart27 commented 2026-04-25 18:34:32 +00:00 (Migrated from github.com)

Scrollbars are currently based on a 0-1 scroll value.

This is ridiculously bad for many reasons, the main one being loss of precision for big ratios.

A scrollbar should have three parameters instead, similar to how Windows does it:

unit: integer, -- current unit index
units: integer, -- total unit count
unit_size: integer, -- size of one unit in screen pixels

Where "unit" usually just means line. I propose unit instead of line because we also have horizontal scrollbars which scroll by character, not line.

Scrollbars are currently based on a 0-1 scroll value. This is ridiculously bad for many reasons, the main one being loss of precision for big `ratio`s. A scrollbar should have three parameters instead, similar to how Windows does it: ```lua unit: integer, -- current unit index units: integer, -- total unit count unit_size: integer, -- size of one unit in screen pixels ``` Where "unit" usually just means line. I propose unit instead of line because we also have horizontal scrollbars which scroll by character, not line.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mupen64/ugui#77
No description provided.