Change the return value for getHorizontalScrollPosition

Create issue
Issue #451 resolved
Michael A created an issue

See this thread:

getHorizontalScrollPosition() currently returns a float indicating the scrollbar's left edge's pixel position in its scroll track as a percentage of the width of the full track. This is not very intuitive and the value most commonly needed would probably be the percent scrolled in the range [0.f..1.f].

The recommendation is to change the return type of this and related methods to a UDim that both provides the percent scrolled as well as the pixel distance from the start of the scroll track (UDim::scale and UDim::offset, respectively).

Reproducibility: always

Comments (3)

  1. Michael A reporter

    An alternative, but more invasive, change could be to rename the method to something like "getScrollPositionInPixels" and a supporting "getScrollPositionInPercent".

  2. Paul Turner

    changeset: 3174:8772cce1e83a user: Paul Turner <> date: Wed Feb 29 11:26:55 2012 +0000 summary: MOD: Change ScrollablePane so that the functions to get and set current scroll positions operate on the interval [0,1], rather one where the upper endpoint was a value dependent on the size of the pane.

  3. Log in to comment