juhojo / corejumper

Platformer game
MIT License
2 stars 0 forks source link

Clicking on scrollbar track inaccurate #10

Closed ilpoo closed 7 years ago

ilpoo commented 7 years ago

It currently tries to place the bottom of the scrollbar handle where you clicked on the the scrollbar track. Instead, it should calculate the percentage of the location you clicked relative to the track height and scroll the page by that percentage. This is how normal scrollbars work in Windows.

juhojo commented 7 years ago

Scrollbar's handle now gets positioned with percentages and then the content gets scrolled according to that percentage of the contents height. The handle gets positioned to center.

juhojo commented 7 years ago

We could try positioning the handle to top instead if it seems more user friendly (in short content such as Guide the handle seems to move quite a lot but in longer content such as Levels it looks fine as it is), but we can get back to this later.