Skip to content

Conversation

Stubbjax
Copy link

This change corrects the vertical scroll speed for different screen heights, which was using integer division and losing the fractional part of the aspect ratio.

@xezon
Copy link

xezon commented Aug 24, 2025

Does this fix #83 ?

@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Input Bug Something is not working right, typically is user facing labels Aug 24, 2025
@Mauller
Copy link

Mauller commented Aug 24, 2025

i wonder if the differences in the vertical and horizontal scroll factor are to make up for this, because with this change vertical scrolling is now a lot faster than horizontal scrolling.

@Stubbjax
Copy link
Author

Does this fix #83 ?

I don't think so, as horizontal and vertical scroll speeds are still different. This change just corrects the awkward aspect calculation for different aspect ratios, most notably 16:9 and 16:10.

For example, at 1920×1200 resolution, getHeight() returns 960 as the control bar takes up 1/5 of the screen's height. This leads to a view aspect value of 2 (1920 ÷ 960). After hiding the control bar, getHeight() returns the full screen height of 1200. However, before this change, 1920 ÷ 1200 returns a screen aspect of 1 instead of the expected 1.6, as the fractional part is dropped due to integer division. This has the effect of halving the vertical scroll speed when hiding the control bar.

Below is a table of common screen resolutions and their expected screen and view aspect ratios. The fractional parts of the aspects are dropped before this change.

image

@xezon xezon changed the title bugfix: Correct viewport vertical scroll speed bugfix(scrolling): Fix vertical scroll speed discrepancies with different aspect ratios Aug 24, 2025
@xezon
Copy link

xezon commented Aug 25, 2025

This change correctly identifies the problematic aspect ratio math, but effectively does not properly fix the vertical scroll speed. The new change #1492 addresses that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working right, typically is user facing Gen Relates to Generals Input Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants